From b87a6735b5acc481bf6a33a9b1d49ec2e671340f Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 8 May 2023 10:10:53 +0200 Subject: [PATCH] Add hr before first footnote in footer Signed-off-by: Sebastian Martinez --- src/lib/markdown.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/markdown.ts b/src/lib/markdown.ts index be383a8a7..74b97d223 100644 --- a/src/lib/markdown.ts +++ b/src/lib/markdown.ts @@ -85,7 +85,9 @@ const footnoteMarkedExtension = { } }, renderer: (token: marked.Tokens.Generic) => { - return `

${ + return `${ + token.reference === "0" ? "


" : "" + }

${ token.reference }. ${marked.parseInline( token.text, @@ -116,11 +118,11 @@ const anchorMarkedExtension = { }, }; -// Overwrites the rendering of heading tokens. -// Since there are possible non ASCII characters in headings, -// we escape them by replacing them with dashes and, -// trim eventual dashes on each side of the string. export const renderer = { + // Overwrites the rendering of heading tokens. + // Since there are possible non ASCII characters in headings, + // we escape them by replacing them with dashes and, + // trim eventual dashes on each side of the string. heading(text: string, level: 1 | 2 | 3 | 4 | 5 | 6) { const escapedText = text .toLowerCase()