mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #49964 markdown-it: remove dependency highlight.js (and only keep @types/highlight.js) to resolve vulnerability GHSA-7wwv-vh3v-89cq by @UNIDY2002
* Bump dependency `highlight.js` of `types/markdown-it` from 9.7.0 to 10.4.1 * Add support for changed API of `markdown-it` (https://github.com/markdown-it/markdown-it/issues/626) at 12.0.0 * Revert dependency `highlight.js` to ^9.7.0 (So that the TypeScript version can remain 2.0, and will not break the requirements of the dependents of this library.) * Adjust test code for types/markdown-it
This commit is contained in:
2
types/markdown-it/index.d.ts
vendored
2
types/markdown-it/index.d.ts
vendored
@@ -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>
|
||||
|
||||
8
types/markdown-it/lib/index.d.ts
vendored
8
types/markdown-it/lib/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"highlight.js": "^9.7.0",
|
||||
"@types/highlight.js": "^9.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ""; },
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user