markup/goldmark: Improve attributes vs options

Fixes #9571
This commit is contained in:
Bjørn Erik Pedersen
2022-02-26 17:24:10 +01:00
parent 928a896962
commit 579ff9b652
6 changed files with 41 additions and 19 deletions

View File

@@ -50,7 +50,8 @@ type AttributesOwnerType int
const (
AttributesOwnerGeneral AttributesOwnerType = iota
AttributesOwnerCodeBlock
AttributesOwnerCodeBlockChroma
AttributesOwnerCodeBlockCustom
)
func New(astAttributes []ast.Attribute, ownerType AttributesOwnerType) *AttributesHolder {
@@ -99,7 +100,7 @@ func New(astAttributes []ast.Attribute, ownerType AttributesOwnerType) *Attribut
panic(fmt.Sprintf("not implemented: %T", vvv))
}
if ownerType == AttributesOwnerCodeBlock && chromaHightlightProcessingAttributes[nameLower] {
if ownerType == AttributesOwnerCodeBlockChroma && chromaHightlightProcessingAttributes[nameLower] {
attr := Attribute{Name: string(v.Name), Value: vv}
opts = append(opts, attr)
} else {