mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
markup/goldmark: Add removeSurroundingParagraph for Markdown images
* Removes any surrounding paragraph nodes * And transfers any attributes from the surrounding paragraph down to the image node * Adds IsBlock and Ordinal (zero based) field to the image context passed to the image render hooks IsBlock is set to true if `wrapStandAloneImageWithinParagraph = false` and the image's parent node has only one child. Closes #8362 Fixes #10492 Fixes #10494 Fixes #10501
This commit is contained in:
@@ -126,6 +126,9 @@ func (a Attribute) ValueString() string {
|
||||
return cast.ToString(a.Value)
|
||||
}
|
||||
|
||||
// Empty holds no attributes.
|
||||
var Empty = &AttributesHolder{}
|
||||
|
||||
type AttributesHolder struct {
|
||||
// What we get from Goldmark.
|
||||
attributes []Attribute
|
||||
|
Reference in New Issue
Block a user