forked from tangled.org/core
this repo has no description

appview/pages/markup: add footnot support

Signed-off-by: oppiliappan <me@oppi.li>

Changed files
+6
appview
pages
+3
appview/pages/markup/markdown.go
···
),
highlighting.WithCustomStyle(styles.Get("catppuccin-latte")),
),
+
extension.NewFootnote(
+
extension.WithFootnoteIDPrefix([]byte("footnote")),
+
),
),
goldmark.WithParserOptions(
parser.WithAutoHeadingID(),
+1
appview/pages/markup/sanitizer.go
···
// 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
+2
input.css
···
.prose li:has(input) {
list-style: none;
+
.prose a.footnote-backref {
+
@apply no-underline;
}
.prose li {