mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
markup/goldmark: Add attributes support for blocks (tables etc.)
E.g.: ``` > foo > bar {.myclass} ``` There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.: ``` * Fruit * Apple * Orange * Banana {.fruits} * Dairy * Milk * Cheese {.dairies} {.list} ``` Fixes #7548
This commit is contained in:
@@ -46,6 +46,8 @@ func TestConfig(t *testing.T) {
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(conf.Goldmark.Renderer.Unsafe, qt.Equals, true)
|
||||
c.Assert(conf.BlackFriday.Fractions, qt.Equals, true)
|
||||
c.Assert(conf.Goldmark.Parser.Attribute.Title, qt.Equals, true)
|
||||
c.Assert(conf.Goldmark.Parser.Attribute.Block, qt.Equals, false)
|
||||
|
||||
c.Assert(conf.AsciidocExt.WorkingFolderCurrent, qt.Equals, true)
|
||||
c.Assert(conf.AsciidocExt.Extensions[0], qt.Equals, "asciidoctor-html5s")
|
||||
@@ -63,6 +65,14 @@ func TestConfig(t *testing.T) {
|
||||
v.Set("footnoteReturnLinkContents", "myreturn")
|
||||
v.Set("pygmentsStyle", "hugo")
|
||||
v.Set("pygmentsCodefencesGuessSyntax", true)
|
||||
|
||||
v.Set("markup", map[string]interface{}{
|
||||
"goldmark": map[string]interface{}{
|
||||
"parser": map[string]interface{}{
|
||||
"attribute": false, // Was changed to a struct in 0.81.0
|
||||
},
|
||||
},
|
||||
})
|
||||
conf, err := Decode(v)
|
||||
|
||||
c.Assert(err, qt.IsNil)
|
||||
@@ -72,5 +82,8 @@ func TestConfig(t *testing.T) {
|
||||
c.Assert(conf.Highlight.Style, qt.Equals, "hugo")
|
||||
c.Assert(conf.Highlight.CodeFences, qt.Equals, true)
|
||||
c.Assert(conf.Highlight.GuessSyntax, qt.Equals, true)
|
||||
c.Assert(conf.Goldmark.Parser.Attribute.Title, qt.Equals, false)
|
||||
c.Assert(conf.Goldmark.Parser.Attribute.Block, qt.Equals, false)
|
||||
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user