Skip to content

Commit ef37fca

Browse files
Update to marked 4 to prevent security issues
1 parent bd942cc commit ef37fca

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

packages/dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"react-dom": "^16.14.0",
2323
"react-i18next": "^11.7.3",
2424
"react-router-dom": "^5.2.0",
25-
"marked": "^3.0.0",
25+
"marked": "^4.0.0",
2626
"lodash-es": "^4.17.21"
2727
},
2828
"devDependencies": {

packages/module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@patternfly/react-core": ">=4.115.2",
4949
"react": ">=16.8.0",
5050
"react-dom": ">=16.8.0",
51-
"marked": "^15.0.6"
51+
"marked": "^4.0.0"
5252
},
5353
"dependencies": {
5454
"@patternfly/react-catalog-view-extension": "^4.93.15",

packages/module/src/ConsoleInternal/components/markdown-view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { css } from '@patternfly/react-styles';
3-
import { parse } from 'marked';
3+
import { marked } from 'marked';
44
import { useForceRender } from '@console/shared';
55
import { QuickStartContext, QuickStartContextValues } from '../../utils/quick-start-context';
66
import './_markdown-view.scss';
@@ -53,7 +53,7 @@ export const markdownConvert = async (markdown: string, extensions?: ShowdownExt
5353

5454
// Replace code fences with non markdown formatting relates tokens so that marked doesn't try to parse them as code spans
5555
const markdownWithSubstitutedCodeFences = markdown.replace(/```/g, '@@@');
56-
const parsedMarkdown = await parse(markdownWithSubstitutedCodeFences);
56+
const parsedMarkdown = await marked.parse(markdownWithSubstitutedCodeFences);
5757
// Swap the temporary tokens back to code fences before we run the extensions
5858
let md = parsedMarkdown.replace(/@@@/g, '```');
5959

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
declare module '*.scss';
22
declare module '*.json';
3+
declare module 'marked';

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10645,10 +10645,10 @@ markdown-table@^2.0.0:
1064510645
dependencies:
1064610646
repeat-string "^1.0.0"
1064710647

10648-
marked@^3.0.0:
10649-
version "3.0.8"
10650-
resolved "https://registry.yarnpkg.com/marked/-/marked-3.0.8.tgz#2785f0dc79cbdc6034be4bb4f0f0a396bd3f8aeb"
10651-
integrity sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==
10648+
marked@^4.0.0:
10649+
version "4.3.0"
10650+
resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3"
10651+
integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==
1065210652

1065310653
matcher-collection@^2.0.0:
1065410654
version "2.0.1"

0 commit comments

Comments
 (0)