diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-12-23 16:38:50 -0600 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-12-23 22:38:50 +0000 |
commit | e6ceb6880a8615ad5b8b6a88a0b1bfbd85f4033c (patch) | |
tree | 5ffdd08dbf265b35f1405683242a4c8c80ff41eb /modules/markup/markdown/markdown.go | |
parent | 071e7c4f0a31ee8b2039b90bb478f13cac62abae (diff) | |
download | gitea-e6ceb6880a8615ad5b8b6a88a0b1bfbd85f4033c.tar.gz gitea-e6ceb6880a8615ad5b8b6a88a0b1bfbd85f4033c.zip |
Prefix all user-generated IDs in markup (#9477)
* Prefix all user-generated IDs in markup
* Add user-content- to IDs in unit-tests
* fixup markdown_test.go
* update the hrefs for the wiki test
* Add blackfriday extension regex
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'modules/markup/markdown/markdown.go')
-rw-r--r-- | modules/markup/markdown/markdown.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/markup/markdown/markdown.go b/modules/markup/markdown/markdown.go index fc704243e2..f1e44a8fbc 100644 --- a/modules/markup/markdown/markdown.go +++ b/modules/markup/markdown/markdown.go @@ -146,7 +146,9 @@ const ( func RenderRaw(body []byte, urlPrefix string, wikiMarkdown bool) []byte { renderer := &Renderer{ Renderer: blackfriday.NewHTMLRenderer(blackfriday.HTMLRendererParameters{ - Flags: blackfridayHTMLFlags, + Flags: blackfridayHTMLFlags, + FootnoteAnchorPrefix: "user-content-", + HeadingIDPrefix: "user-content-", }), URLPrefix: urlPrefix, IsWiki: wikiMarkdown, |