mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
markup/goldmark: Fix attribute nilpointer
Fixes 9819
This commit is contained in:
@@ -101,7 +101,7 @@ func (a *transformer) Transform(node *ast.Document, reader text.Reader, pc parse
|
||||
// Attributes for fenced code blocks are handled in their own extension,
|
||||
// but note that we currently only support code block attributes when
|
||||
// CodeFences=true.
|
||||
if node.PreviousSibling().Kind() != ast.KindFencedCodeBlock && !node.HasBlankPreviousLines() {
|
||||
if node.PreviousSibling() != nil && node.PreviousSibling().Kind() != ast.KindFencedCodeBlock && !node.HasBlankPreviousLines() {
|
||||
attributes = append(attributes, node)
|
||||
return ast.WalkSkipChildren, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user