diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-12-03 12:33:48 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-12-05 15:00:47 +0100 |
commit | 63126c6359a693345a3a81b22e0f95660b248044 (patch) | |
tree | 7f2fdf6af58735564cf3be57efbdad594150fa05 /markup/internal | |
parent | 535ea8cc9bf20b1ba6f656f9f3eee3818c6dc537 (diff) | |
download | hugo-63126c6359a693345a3a81b22e0f95660b248044.tar.gz hugo-63126c6359a693345a3a81b22e0f95660b248044.zip |
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
Diffstat (limited to 'markup/internal')
-rw-r--r-- | markup/internal/attributes/attributes.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/markup/internal/attributes/attributes.go b/markup/internal/attributes/attributes.go index 688740983..a67b51acb 100644 --- a/markup/internal/attributes/attributes.go +++ b/markup/internal/attributes/attributes.go @@ -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 |