mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +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:
@@ -37,7 +37,10 @@ var Default = Config{
|
||||
Parser: Parser{
|
||||
AutoHeadingID: true,
|
||||
AutoHeadingIDType: AutoHeadingIDTypeGitHub,
|
||||
Attribute: true,
|
||||
Attribute: ParserAttribute{
|
||||
Title: true,
|
||||
Block: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -82,5 +85,12 @@ type Parser struct {
|
||||
AutoHeadingIDType string
|
||||
|
||||
// Enables custom attributes.
|
||||
Attribute bool
|
||||
Attribute ParserAttribute
|
||||
}
|
||||
|
||||
type ParserAttribute struct {
|
||||
// Enables custom attributes for titles.
|
||||
Title bool
|
||||
// Enables custom attributeds for blocks.
|
||||
Block bool
|
||||
}
|
||||
|
Reference in New Issue
Block a user