Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown-it: remove dependency highlight.js (and only keep @types/highlight.js) to resolve vulnerability GHSA-7wwv-vh3v-89cq #49964

Merged
merged 4 commits into from Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/markdown-it/index.d.ts
@@ -1,4 +1,4 @@
// Type definitions for markdown-it v10.0.0
// Type definitions for markdown-it v12.0.2
// Project: https://github.com/markdown-it/markdown-it
// Definitions by: York Yao <https://github.com/plantain-00>
// Robert Coie <https://github.com/rapropos>
Expand Down
8 changes: 4 additions & 4 deletions types/markdown-it/lib/index.d.ts
Expand Up @@ -82,12 +82,12 @@ declare namespace MarkdownIt {

/**
* Highlighter function for fenced code blocks.
* Highlighter `function (str, lang)` should return escaped HTML. It can also
* return empty string if the source was not changed and should be escaped
* externaly. If result starts with <pre... internal wrapper is skipped.
* Highlighter `function (str, lang, attrs)` should return escaped HTML. It can
* also return empty string if the source was not changed and should be escaped
* externally. If result starts with <pre... internal wrapper is skipped.
* @default null
*/
highlight?: ((str: string, lang: string) => string) | null;
highlight?: ((str: string, lang: string, attrs: string) => string) | null;
}

type PluginSimple = (md: MarkdownIt) => void;
Expand Down
1 change: 0 additions & 1 deletion types/markdown-it/package.json
@@ -1,7 +1,6 @@
{
"private": true,
"dependencies": {
"highlight.js": "^9.7.0",
"@types/highlight.js": "^9.7.0"
}
}
12 changes: 12 additions & 0 deletions types/markdown-it/test/index.ts
Expand Up @@ -46,6 +46,18 @@ import LinkifyIt = require('linkify-it');
quotes: '\u201c\u201d\u2018\u2019' /* “”‘’ */,
highlight: null,
};

// highlight
options = {
html: false,
xhtmlOut: false,
breaks: false,
langPrefix: 'language-',
linkify: false,
typographer: false,
quotes: '\u201c\u201d\u2018\u2019' /* “”‘’ */,
highlight: function(str, lang, attrs) { return ""; },
};
}

{
Expand Down