fix: docs markdown smartypants (#2671)

This was a regression introduced in
https://github.com/denoland/fresh/pull/2655

Fixes https://github.com/denoland/fresh/issues/2670
This commit is contained in:
Marvin Hagemeister
2024-10-02 11:43:47 +02:00
committed by GitHub
parent 182bda5b7f
commit 1081aa2eb9
9 changed files with 123 additions and 1083 deletions
+2 -3
View File
@@ -31,15 +31,14 @@ class DefaultRenderer extends Marked.Renderer {
override text(
token: Marked.Tokens.Text | Marked.Tokens.Escape | Marked.Tokens.Tag,
): string {
let text = token.text;
if (
token.type === "text" && "tokens" in token && token.tokens !== undefined
) {
text = this.parser.parseInline(token.tokens);
return this.parser.parseInline(token.tokens);
}
// Smartypants typography enhancement
return text
return token.text
.replaceAll("...", "…")
.replaceAll("--", "—")
.replaceAll("---", "–")