Skip to content

Commit

Permalink
Add test for line anchor attributes with code fences
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Feb 24, 2022
1 parent 08fdca9 commit 92e0549
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions markup/goldmark/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ func TestConvertAttributes(t *testing.T) {
"table style",
},
},
{
"Code block, CodeFences=true,lineanchors",
func(conf *markup_config.Config) {
withBlockAttributes(conf)
conf.Highlight.CodeFences = true
},
"```bash {linenos=table, anchorlinenos=true, lineanchors=org-coderef--xyz}\necho 'foo';\n```",
"<div class=\"highlight\"><div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;\"><tr><td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code><span style=\"white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\" 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 style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre tabindex=\"0\" style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"display:flex;\"><span>echo <span style=\"color:#e6db74\">&#39;foo&#39;</span>;\n</span></span></code></pre></td></tr></table>\n</div>\n</div>",
},
{
"Paragraph",
withBlockAttributes,
Expand Down

0 comments on commit 92e0549

Please sign in to comment.