Skip to content

Commit

Permalink
fix: [CVE-2020-7753] Update remark to 13.0.0 (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
poteirard committed Nov 10, 2020
1 parent d80a190 commit 2b7bfe2
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 284 deletions.
358 changes: 137 additions & 221 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -83,7 +83,7 @@
"react-icons": "^3.8.0",
"react-simple-code-editor": "^0.10.0",
"recast": "~0.18.5",
"remark": "^11.0.1",
"remark": "^13.0.0",
"strip-html-comments": "^1.0.0",
"terser-webpack-plugin": "^4.1.0",
"to-ast": "^1.0.0",
Expand Down
Expand Up @@ -91,7 +91,7 @@ Array [
Object {
"content": "# Header
Text with _some_ **formatting** and a [link](/foo).
Text with *some* **formatting** and a [link](/foo).
<div>And some HTML.</div>
Expand Down
20 changes: 0 additions & 20 deletions src/loaders/utils/__tests__/noAutoLinkRemarkPlugin.spec.ts

This file was deleted.

7 changes: 2 additions & 5 deletions src/loaders/utils/chunkify.ts
Expand Up @@ -63,14 +63,11 @@ export default function chunkify(
};
}

const rendered = remark()
.use(processCode)
.processSync(markdown)
.toString();
const rendered = remark().use(processCode).processSync(markdown).toString();

const chunks: (Rsg.CodeExample | Rsg.MarkdownExample)[] = [];
const textChunks = rendered.split(CODE_PLACEHOLDER);
textChunks.forEach(chunk => {
textChunks.forEach((chunk) => {
chunk = chunk.trim();
if (chunk) {
chunks.push({
Expand Down
7 changes: 1 addition & 6 deletions src/loaders/utils/highlightCodeInMarkdown.ts
@@ -1,7 +1,6 @@
import remark from 'remark';
import visit from 'unist-util-visit';
import highlightCode from './highlightCode';
import noAutoLink from './noAutoLinkRemarkPlugin';

function highlight() {
return (ast: any) => {
Expand All @@ -18,9 +17,5 @@ function highlight() {
* @returns {string}
*/
export default function highlightCodeInMarkdown(markdown: string): string {
return remark()
.use(highlight)
.use(noAutoLink)
.processSync(markdown)
.toString();
return remark().use(highlight).processSync(markdown).toString();
}
30 changes: 0 additions & 30 deletions src/loaders/utils/noAutoLinkRemarkPlugin.ts

This file was deleted.

0 comments on commit 2b7bfe2

Please sign in to comment.