Skip to content

Commit 2b7bfe2

Browse files
authored
fix: [CVE-2020-7753] Update remark to 13.0.0 (#1710)
1 parent d80a190 commit 2b7bfe2

File tree

7 files changed

+142
-284
lines changed

7 files changed

+142
-284
lines changed

package-lock.json

Lines changed: 137 additions & 221 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"react-icons": "^3.8.0",
8484
"react-simple-code-editor": "^0.10.0",
8585
"recast": "~0.18.5",
86-
"remark": "^11.0.1",
86+
"remark": "^13.0.0",
8787
"strip-html-comments": "^1.0.0",
8888
"terser-webpack-plugin": "^4.1.0",
8989
"to-ast": "^1.0.0",

src/loaders/utils/__tests__/__snapshots__/chunkify.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Array [
9191
Object {
9292
"content": "# Header
9393
94-
Text with _some_ **formatting** and a [link](/foo).
94+
Text with *some* **formatting** and a [link](/foo).
9595
9696
<div>And some HTML.</div>
9797

src/loaders/utils/__tests__/noAutoLinkRemarkPlugin.spec.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/loaders/utils/chunkify.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,11 @@ export default function chunkify(
6363
};
6464
}
6565

66-
const rendered = remark()
67-
.use(processCode)
68-
.processSync(markdown)
69-
.toString();
66+
const rendered = remark().use(processCode).processSync(markdown).toString();
7067

7168
const chunks: (Rsg.CodeExample | Rsg.MarkdownExample)[] = [];
7269
const textChunks = rendered.split(CODE_PLACEHOLDER);
73-
textChunks.forEach(chunk => {
70+
textChunks.forEach((chunk) => {
7471
chunk = chunk.trim();
7572
if (chunk) {
7673
chunks.push({

src/loaders/utils/highlightCodeInMarkdown.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import remark from 'remark';
22
import visit from 'unist-util-visit';
33
import highlightCode from './highlightCode';
4-
import noAutoLink from './noAutoLinkRemarkPlugin';
54

65
function highlight() {
76
return (ast: any) => {
@@ -18,9 +17,5 @@ function highlight() {
1817
* @returns {string}
1918
*/
2019
export default function highlightCodeInMarkdown(markdown: string): string {
21-
return remark()
22-
.use(highlight)
23-
.use(noAutoLink)
24-
.processSync(markdown)
25-
.toString();
20+
return remark().use(highlight).processSync(markdown).toString();
2621
}

src/loaders/utils/noAutoLinkRemarkPlugin.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)