Attributes for code fences should be placed after the lang indicator only

Fixes #8313
This commit is contained in:
Bjørn Erik Pedersen
2021-03-20 16:36:30 +01:00
parent 35dedf15c0
commit b725253f9e
3 changed files with 28 additions and 4 deletions

View File

@@ -242,9 +242,19 @@ func TestConvertAttributes(t *testing.T) {
withBlockAttributes(conf)
conf.Highlight.CodeFences = true
},
"```bash\necho 'foo';\n````\n{.myclass id=\"myid\"}",
"```bash {.myclass id=\"myid\"}\necho 'foo';\n````\n",
"<div class=\"highlight myclass\" id=\"myid\"><pre style",
},
{
"Code block, CodeFences=true,linenos=table",
func(conf *markup_config.Config) {
withBlockAttributes(conf)
conf.Highlight.CodeFences = true
},
"```bash {linenos=table .myclass id=\"myid\"}\necho 'foo';\n````\n{ .adfadf }",
[]string{"div class=\"highlight myclass\" id=\"myid\"><div s",
"table style"},
},
{
"Paragraph",
withBlockAttributes,