Skip to content

Included markdown via RenderShortcodes is escaped as of Hugo 0.146.x #13668

@chalin

Description

@chalin

The attached test project uses .RenderShortcodes to include Markdown from snippets files, as illustrated in the Hugo docs.

The test project snippet contains the following markdown:

"Hello, world!"

For more greetings, see <http://example.com>.

In Hugo 0.145.x, this gets rendered as:

<p>&ldquo;Hello, world!&rdquo;</p>
<p>For more greetings, see <a href="http://example.com">http://example.com</a>.</p>

As of Hugo 0.146.x, this gets rendered as:

<p>&quot;Hello, world!&quot;</p>
<p>For more greetings, see &lt;http://example.com&gt;.</p>

Notice how the raw URL markdown syntax is escaped, and the rendered plain &quot; instead of left- and right quotes.

The layout files are as follows:

Image

The functionality of getting the markdown snippets is implemented via layouts/partials/getmd.md. The getmd.md partial is reused in other partials. The include shortcode is just a wrapper so that the get functionality can be used directly from markdown files.

Here's the test project: hugo-getmd-test.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions