diff --git a/appview/pages/markup/markdown.go b/appview/pages/markup/markdown.go index b00081a2..a3dfb155 100644 --- a/appview/pages/markup/markdown.go +++ b/appview/pages/markup/markdown.go @@ -56,6 +56,9 @@ func (rctx *RenderContext) RenderMarkdown(source string) string { ), highlighting.WithCustomStyle(styles.Get("catppuccin-latte")), ), + extension.NewFootnote( + extension.WithFootnoteIDPrefix([]byte("footnote")), + ), ), goldmark.WithParserOptions( parser.WithAutoHeadingID(), diff --git a/appview/pages/markup/sanitizer.go b/appview/pages/markup/sanitizer.go index 92696374..6ba27cc1 100644 --- a/appview/pages/markup/sanitizer.go +++ b/appview/pages/markup/sanitizer.go @@ -64,6 +64,7 @@ func defaultPolicy() *bluemonday.Policy { // for code blocks policy.AllowAttrs("class").Matching(regexp.MustCompile(`chroma`)).OnElements("pre") + policy.AllowAttrs("class").Matching(regexp.MustCompile(`anchor|footnote-ref|footnote-backref`)).OnElements("a") policy.AllowAttrs("class").Matching(regexp.MustCompile(strings.Join(slices.Collect(maps.Values(chroma.StandardTypes)), "|"))).OnElements("span") // centering content diff --git a/input.css b/input.css index a5261f43..33c70da7 100644 --- a/input.css +++ b/input.css @@ -136,6 +136,8 @@ .prose li:has(input) { list-style: none; + .prose a.footnote-backref { + @apply no-underline; } .prose li {