Skip to content

Commit b7d13b3

Browse files
fix(CodeBlock): Add new syntax highlighter (#682)
We had previously dropped react-syntax-highlighter due to a vulnerability. It has been several months and they have yet to fix it, though are making progress. Rehype-highlight is maintained by unified, which maintains the Markdown processor, and seems better maintained. We can swap out the highlighting style to any of these options very easily if needed as well: https://highlightjs.org/examples
1 parent 8fd3ccc commit b7d13b3

5 files changed

Lines changed: 422 additions & 2 deletions

File tree

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
collectCoverage: true,
88
// most of these are to fix https://github.com/remarkjs/react-markdown/issues/635
99
transformIgnorePatterns: [
10-
'node_modules/(?!@patternfly|@data-driven-forms|remark-gfm|react-markdown|remark-parse|devlop|hast-util-to-jsx-runtime|comma-separated-tokens|estree-util-is-identifier-name|hast-util-whitespace|property-information|space-separated-tokens|unist-util-position|vfile-message|unist-util-stringify-position|html-url-attributes|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|remark-rehype|mdast-util-to-hast|trim-lines|unist-util-visit|unist-util-is|unified|bail|is-plain-obj|trough|vfile|mdast-util-gfm|ccount|mdast-util-find-and-replace|escape-string-regexp|markdown-table|mdast-util-to-markdown|zwitch|longest-streak|mdast-util-phrasing)'
10+
'node_modules/(?!@patternfly|@data-driven-forms|remark-gfm|react-markdown|remark-parse|devlop|hast-util-to-jsx-runtime|comma-separated-tokens|estree-util-is-identifier-name|hast-util-whitespace|property-information|space-separated-tokens|unist-util-position|vfile-message|unist-util-stringify-position|html-url-attributes|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|remark-rehype|mdast-util-to-hast|trim-lines|unist-util-visit|unist-util-is|unified|bail|is-plain-obj|trough|vfile|mdast-util-gfm|ccount|mdast-util-find-and-replace|escape-string-regexp|markdown-table|mdast-util-to-markdown|zwitch|longest-streak|mdast-util-phrasing|rehype-highlight)'
1111
// Uncomment the below line if you face any errors with jest
1212
// '/node_modules/(?!@redhat-cloud-services)',
1313
],

0 commit comments

Comments
 (0)