Skip to content

Commit

Permalink
chore: fix imports in tests, update dompurify
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjagodic committed Aug 9, 2024
1 parent 614b3dc commit 2d0e60a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/decap-cms-widget-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward"
},
"dependencies": {
"dompurify": "^2.2.6",
"dompurify": "^3.1.6",
"is-hotkey": "^0.2.0",
"is-url": "^1.2.4",
"mdast-util-definitions": "^1.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import unified from 'unified';
import markdownToRemark from 'remark-parse';
import remarkParse from 'remark-parse';

import remarkAllowHtmlEntities from '../remarkAllowHtmlEntities';

function process(markdown) {
const mdast = unified().use(markdownToRemark).use(remarkAllowHtmlEntities).parse(markdown);
const mdast = unified().use(remarkParse).use(remarkAllowHtmlEntities).parse(markdown);

/**
* The MDAST will look like:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import unified from 'unified';
import markdownToRemark from 'remark-parse';
import remarkParse from 'remark-parse';
import remarkToMarkdown from 'remark-stringify';

import remarkPaddedLinks from '../remarkPaddedLinks';

function input(markdown) {
return unified()
.use(markdownToRemark)
.use(remarkParse)
.use(remarkPaddedLinks)
.use(remarkToMarkdown)
.processSync(markdown).contents;
}

function output(markdown) {
return unified().use(markdownToRemark).use(remarkToMarkdown).processSync(markdown).contents;
return unified().use(remarkParse).use(remarkToMarkdown).processSync(markdown).contents;
}

describe('remarkPaddedLinks', () => {
Expand Down

0 comments on commit 2d0e60a

Please sign in to comment.