diff --git a/docs/latest/getting-started/create-a-route.md b/docs/latest/getting-started/create-a-route.md index 0356f5ffa27..508eb0a9cd8 100644 --- a/docs/latest/getting-started/create-a-route.md +++ b/docs/latest/getting-started/create-a-route.md @@ -52,7 +52,7 @@ The new page will be visible at `http://localhost:8000/about`. pages in the _Getting Started_ guide will also explain more features of routes. --> [concepts-routing]: /docs/concepts/routing -[jsx]: https://reactjs.org/docs/introducing-jsx.html +[jsx]:https://react.dev/learn/writing-markup-with-jsx [preact]: https://preactjs.com/ diff --git a/www/utils/markdown.ts b/www/utils/markdown.ts index 89d7bb76cb1..f7d96046ed5 100644 --- a/www/utils/markdown.ts +++ b/www/utils/markdown.ts @@ -113,22 +113,27 @@ class DefaultRenderer extends Marked.Renderer { return out; } - override blockquote({ text }: Marked.Tokens.Blockquote): string { + override blockquote({ text, tokens }: Marked.Tokens.Blockquote): string { const match = text.match(ADMISSION_REG); + if (match) { const label: Record = { tip: "Tip", warn: "Warning", info: "Info", }; + Marked.walkTokens(tokens, (token) => { + if (token.type === "text" && token.text.startsWith(match[0])) { + token.text = token.text.slice(match[0].length); + } + }); const type = match[1]; - text = text.slice(match[0].length); const icon = ``; return `
\n${icon}${ label[type] - }${Marked.parse(text)}
\n`; + }${Marked.parser(tokens)}\n`; } - return `
\n${Marked.parse(text)}
\n`; + return `
\n${Marked.parser(tokens)}
\n`; } }