Skip to content

Add "block" option/action to markdownify #3040

@alizain

Description

@alizain

As @robsonsobral commented in the original issue #1025 that added this "functionality", this is really non-standard, confusing behaviour. Why was it added in? More importantly, can it be removed, or put behind a config option?

For context, refer to this commit be627fa. Hugo manually strips the leading and trailing paragraph tags, thereby rendering the markdownify function useless for any string that contains block level markdown.

This can cause major bugs! For example, if your yaml frontmatter looks like this:

somekey: |
  This is a **valid** markdown paragraph.

  This is another **valid** markdown paragraph. And it's *still valid yaml!*
someotherkey: 2

markdownify will output the following, incorrect HTML, where the opening tag for the first paragraph, and closing tag for the last paragraph are missing!

This is a <strong>valid</strong> markdown paragraph.</p>
<p>This is another <strong>valid</strong> markdown paragraph. And it's <em>still valid yaml!</em>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions