return ast.WalkContinue, nil
}
- text := ctx.PopRenderedString()
+ text := strings.TrimSpace(ctx.PopRenderedString())
ordinal := ctx.GetAndIncrementOrdinal(ast.KindBlockquote)
// tag if the first line of the blockquote content does not have a
// closing p tag. At some point we might want to move this to the
// parser.
- before, after, found := strings.Cut(strings.TrimSpace(text), "\n")
+ before, after, found := strings.Cut(text, "\n")
if found {
if strings.HasSuffix(before, "</p>") {
text = after
"Blockquote Alert: |<p>This is a note with some whitespace after the alert type.</p>|alert|",
"Blockquote Alert: |<p>This is a tip.</p>",
"Blockquote Alert: |<p>This is a caution with some whitespace before the alert type.</p>|alert|",
- "Blockquote: |<p>A regular blockquote.</p>\n|regular|",
+ "Blockquote: |<p>A regular blockquote.</p>|regular|",
"Blockquote Alert Attributes: |<p>This is a tip with attributes.</p>|map[class:foo bar id:baz]|",
filepath.FromSlash("/content/p1.md:19:3"),
"Blockquote Alert Page: |<p>This is a tip with attributes.</p>|p1|p1|",
// Issue 12913
// Issue 13119
+// Issue 13302
func TestBlockquoteRenderHookTextParsing(t *testing.T) {
t.Parallel()
> [!sixteen] _title_
> line one
+> seventeen
`
b := hugolib.Test(t, files)
"AlertType: fourteen|AlertTitle: title|Text: <p><img src=\"a.jpg\" alt=\"alt\"></p>|",
"AlertType: fifteen|AlertTitle: <em>title</em>|Text: |",
"AlertType: sixteen|AlertTitle: <em>title</em>|Text: <p>line one</p>|",
+ "AlertType: |AlertTitle: |Text: <p>seventeen</p>|",
)
}