-
-
Notifications
You must be signed in to change notification settings - Fork 419
chore(deps): bump marked from 12.0.2 to 16.3.0 #5057
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
base: main
Are you sure you want to change the base?
Changes from all commits
3ecf07e
870b5dc
0be1ad7
c069eef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,16 +20,16 @@ const gtEntity = />/gm; | |||||
| const ampEntity = /&/gm; | ||||||
|
|
||||||
| class Renderer extends marked.Renderer { | ||||||
| code(code, infoString, isEscaped) { | ||||||
| const { language, ...metaData } = Renderer.parseInfoString(infoString); | ||||||
| code({ text, lang, escaped }) { | ||||||
| const { language, ...metaData } = Renderer.parseInfoString(lang || ""); | ||||||
|
|
||||||
| // regex to check whether the language is webidl | ||||||
| if (/(^webidl$)/i.test(language)) { | ||||||
| return `<pre class="idl">${code}</pre>`; | ||||||
| return `<pre class="idl">${text}</pre>`; | ||||||
| } | ||||||
|
|
||||||
| const html = super | ||||||
| .code(code, language, isEscaped) | ||||||
| .code({ text, lang: language, escaped }) | ||||||
| .replace(`class="language-`, `class="`); | ||||||
|
|
||||||
| const { example, illegalExample } = metaData; | ||||||
|
|
@@ -40,9 +40,9 @@ class Renderer extends marked.Renderer { | |||||
| return html.replace("<pre>", `<pre title="${title}" class="${className}">`); | ||||||
| } | ||||||
|
|
||||||
| image(href, title, text) { | ||||||
| image({ href, title, text, tokens }) { | ||||||
| if (!title) { | ||||||
| return super.image(href, title, text); | ||||||
| return super.image({ href, title, text, tokens }); | ||||||
| } | ||||||
| const html = String.raw; | ||||||
| return html` | ||||||
|
|
@@ -76,20 +76,20 @@ class Renderer extends marked.Renderer { | |||||
| return { language, ...metaData }; | ||||||
| } | ||||||
|
|
||||||
| heading(text, level, raw) { | ||||||
| heading({ tokens, depth, text }) { | ||||||
| const headingWithIdRegex = /(.+)\s+{#([\w-]+)}$/; | ||||||
| if (headingWithIdRegex.test(text)) { | ||||||
| const [, textContent, id] = text.match(headingWithIdRegex); | ||||||
| return `<h${level} id="${id}">${textContent}</h${level}>`; | ||||||
| return `<h${depth} id="${id}">${textContent}</h${depth}>`; | ||||||
| } | ||||||
| return super.heading(text, level, raw); | ||||||
| return super.heading({ tokens, depth }); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** @type {import('marked').MarkedOptions} */ | ||||||
| const config = { | ||||||
| gfm: true, | ||||||
| renderer: new Renderer(), | ||||||
| renderer: /** @type {any} */ (new Renderer()), | ||||||
|
||||||
| renderer: /** @type {any} */ (new Renderer()), | |
| renderer: /** @type {import('marked').MarkedOptions['renderer']} */ (new Renderer()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR metadata/title says marked is bumped to 16.3.0, but package.json now pins ^16.4.0. Please align the PR title/description (or the dependency version) so reviewers and release notes match what is actually being shipped.