Skip to content

Hugo 0.141.0 strips apostrophes from image alt strings #13286

Closed
@chalin

Description

@chalin

Attached to this issue is a minimalist Hugo project, hugo-141-alt-issue.zip, with the following markdown in the main index.md file:

![A's and B's](some-image.png)

Here's how Hugo 0.140.2 and 0.141.0 render HTML for the markdown image syntax above:

$ hugo  # v0.140.2
Start building sites … 
hugo v0.140.2-...
$ grep some-image public/index.html 
    <p><img src="some-image.png" alt="A&rsquo;s and B&rsquo;s"></p>
$ _hugo  # alias for v0.141.0
Start building sites … 
hugo v0.141.0-...
$ grep some-image public/index.html
    <p><img src="some-image.png" alt="As and Bs"></p>

Note that Hugo 0.141.0 doesn't generate the &rsquo; in the alt text.

Now comment out the languages entry from the project's hugo.yaml config, and Hugo 0.141.0 will generate the &rsquo; once again:

$ grep -E 'lang|en' hugo.yaml
# languages:
#   en:
#     languageCode: en

$ _hugo                            
Start building sites … 
hugo v0.141.0-...
$ grep some-image public/index.html
    <p><img src="some-image.png" alt="A&rsquo;s and B&rsquo;s"></p>

I'm working under macOS.

/cc @svrnm

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions