Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add hr before first footnote in footer
Sebastian Martinez committed 3 years ago
commit b87a6735b5acc481bf6a33a9b1d49ec2e671340f
parent d8d470ae9d287f396f38d1db667c6de7a4f32342
1 file changed +7 -5
modified src/lib/markdown.ts
@@ -85,7 +85,9 @@ const footnoteMarkedExtension = {
    }
  },
  renderer: (token: marked.Tokens.Generic) => {
-
    return `<p class="txt-small" id="${footnotePrefix}:${token.reference}">${
+
    return `${
+
      token.reference === "0" ? "<hr />" : ""
+
    }<p class="txt-small" id="${footnotePrefix}:${token.reference}">${
      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()