Skip to content

mdformat breaks Hugo shortcodes by escaping < #402

Closed
@jamesbraza

Description

@jamesbraza

Describe the bug

context

Running mdformat on a Markdown file with a Hugo shortcode.

expectation

I expected mdformat to not break the shortcode.

bug

Instead mdformat is breaking the shortcode by escaping < to \<.

problem

This breaks the shortcode for Hugo users.

Relevant Hugo comment: #112 (comment)

Reproduce the bug

{{< youtube -dJolYw8tnk >}}

That links to this YouTube video. mdformat corrects this to

{{\< youtube -dJolYw8tnk >}}

List your environment

mdformat==0.7.16
mdformat-frontmatter==2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions