Closed McShelby closed 2 months ago
Not a super frequent contributor to Hugo, but I think the issue is in the following lines:
(blockquotes.go:162)
var blockQuoteAlertRe = regexp.MustCompile(`^<p>\[!([a-zA-Z]+)\](-|\+)?[^\S\r\n]?([^\n]*)\n?`)
func resolveBlockQuoteAlert(s string) blockQuoteAlert {
m := blockQuoteAlertRe.FindStringSubmatch(s)
if len(m) == 4 {
return blockQuoteAlert{
typ: strings.ToLower(m[1]),
sign: m[2],
title: m[3],
}
}
return blockQuoteAlert{}
}
This Regex terminates the title group at \n
, not </p>
, so the </p>
gets included and passed to the renderer. I fixed it by using this Regex: ^<p>\[!([a-zA-Z]+)\](-|\+)?[^\S\r\n]?([^(\n|<\/p>)]*)\n?
. It checks for termination of the title group at both \n
and </p>
.
@LicketySpliket thanks, I tested your regexp, and it didn't pass all the test cases. I opted for a ... simplar non-regexp approach.
No worries bep, thanks for testing it.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Given the following Markdown:
and the following
render-blockquote.html
somtimes results in a closing
</p>
at the end of the titleWhat version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes