diff --git a/markup/goldmark/convert.go b/markup/goldmark/convert.go index 629e2b15a..639fddace 100644 --- a/markup/goldmark/convert.go +++ b/markup/goldmark/convert.go @@ -22,6 +22,7 @@ import ( "runtime/debug" "github.com/gohugoio/hugo/markup/goldmark/internal/extensions/attributes" + "github.com/yuin/goldmark/ast" "github.com/gohugoio/hugo/identity" @@ -321,7 +322,28 @@ func newHighlighting(cfg highlight.Config) goldmark.Extender { highlight.WriteCodeTag(w, language) return } - w.WriteString(`
foo\nbar
\n
\n",
},
+ /*{
+ // TODO(bep) this needs an upstream fix, see https://github.com/yuin/goldmark/issues/195
+ "Code block, CodeFences=false",
+ func(conf *markup_config.Config) {
+ withBlockAttributes(conf)
+ conf.Highlight.CodeFences = false
+ },
+ "```bash\necho 'foo';\n```\n{.myclass}",
+ "TODO",
+ },*/
+ {
+ "Code block, CodeFences=true",
+ func(conf *markup_config.Config) {
+ withBlockAttributes(conf)
+ conf.Highlight.CodeFences = true
+ },
+ "```bash\necho 'foo';\n````\n{.myclass id=\"myid\"}",
+ "')
} else {