You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Hugo are you using (hugo version)?
$ hugo version
hugo v0.112.5-48e33e10af2feb2a0e1c32d04880ed016619f2d8 linux/amd64 BuildDate=2023-05-29T07:27:36Z VendorInfo=gohugoio
Does this issue reproduce with the latest release?
Yes
Description
Quotation marks and apostrophes appearing in image alt-text are double-escaped.
The following Markdown:
!["They didn't even say 'hello'!" I exclaimed.](https://example.com/image.jpg)
is rendered as:
<p><img src="https://example.com/image.jpg" alt="&ldquo;They didn&rsquo;t even say &lsquo;hello&rsquo;!&rdquo; I exclaimed."></p>
Expected output is:
<p><img src="https://example.com/image.jpg" alt="“They didn’t even say ‘hello’!” I exclaimed."></p>
This is not a bug in Goldmark itself, as using that library directly produces the expected output. The bug actually was previously present in Goldmark (GitHub issue) but it has been fixed, so now it appears that this bug now has to do with how Hugo handles the data.
The text was updated successfully, but these errors were encountered:
Confirmed that this is not Go's html/template package doing its thing by setting:
[outputFormats.html]
isPlainText = true
Note that this only affects the attribute value.
Markdown
![He said, "Eat at Joe's."](x)
[He said, "Eat at Joe's."](x)
Rendered
<imgsrc="x" alt="He said, &ldquo;Eat at Joe&rsquo;s.&rdquo;"><ahref="x">He said, “Eat at Joe’s.”</a>
Example
git clone --single-branch -b hugo-github-issue-11045 https://github.com/jmooring/hugo-testing hugo-github-issue-11045
cd hugo-github-issue-11045
hugo server
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
Description
Quotation marks and apostrophes appearing in image alt-text are double-escaped.
The following Markdown:
is rendered as:
Expected output is:
This is not a bug in Goldmark itself, as using that library directly produces the expected output. The bug actually was previously present in Goldmark (GitHub issue) but it has been fixed, so now it appears that this bug now has to do with how Hugo handles the data.
The text was updated successfully, but these errors were encountered: