From 0c5da1106b613341feb557de647c116c6a36307c Mon Sep 17 00:00:00 2001 From: Dogukan Karasakal Date: Tue, 15 Oct 2024 22:07:48 +0200 Subject: [PATCH 1/2] fix: block quotes not rendering links --- www/utils/markdown.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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`; } } From fddfc43d726b685d7e85e6b9ff7f4610789f69c0 Mon Sep 17 00:00:00 2001 From: Dogukan Karasakal Date: Tue, 15 Oct 2024 22:10:43 +0200 Subject: [PATCH 2/2] docs: replace jsx docs with up to date react docs --- docs/latest/getting-started/create-a-route.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/