From 6bffcdbd26d90dc4670cdf31f7ee622a297607af Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Thu, 24 Feb 2022 14:12:45 -0500 Subject: [PATCH] Add test for line anchor attributes with code fences Fixes https://github.com/gohugoio/hugo/issues/9385. --- markup/goldmark/convert_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 @@ -278,6 +278,16 @@ func TestConvertAttributes(t *testing.T) { "table style", }, }, + { + "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```", + "
\n\n
\n
1\n
\n
echo 'foo';\n
\n
\n
", + }, { "Paragraph", withBlockAttributes,