diff options
author | Kaushal Modi <kaushal.modi@gmail.com> | 2022-02-24 14:12:45 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-24 22:54:49 +0100 |
commit | 6bffcdbd26d90dc4670cdf31f7ee622a297607af (patch) | |
tree | 48d5aa2e2146bca4541e8b071d82fbbba0d78720 /markup/goldmark | |
parent | 7248f43188c159519e1427a290267f7f69f91ded (diff) |
Add test for line anchor attributes with code fences
Fixes https://github.com/gohugoio/hugo/issues/9385.
Diffstat (limited to 'markup/goldmark')
-rw-r--r-- | markup/goldmark/convert_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go index ecb308eba..2227d6187 100644 --- a/markup/goldmark/convert_test.go +++ b/markup/goldmark/convert_test.go @@ -279,6 +279,16 @@ func TestConvertAttributes(t *testing.T) { }, }, { + "Code block, CodeFences=true,lineanchors", + func(conf *markup_config.Config) { + withBlockAttributes(conf) + conf.Highlight.CodeFences = true + conf.Highlight.NoClasses = false + }, + "```bash {linenos=table, anchorlinenos=true, lineanchors=org-coderef--xyz}\necho 'foo';\n```", + "<div class=\"highlight\"><div class=\"chroma\">\n<table class=\"lntable\"><tr><td class=\"lntd\">\n<pre tabindex=\"0\" class=\"chroma\"><code><span class=\"lnt\" id=\"org-coderef--xyz-1\"><a style=\"outline: none; text-decoration:none; color:inherit\" href=\"#org-coderef--xyz-1\">1</a>\n</span></code></pre></td>\n<td class=\"lntd\">\n<pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\"><span class=\"nb\">echo</span> <span class=\"s1\">'foo'</span><span class=\"p\">;</span>\n</span></span></code></pre></td></tr></table>\n</div>\n</div>", + }, + { "Paragraph", withBlockAttributes, "\nHi there.\n{.myclass }", |