Skip to content

Single equal symbol is parsed as a Markdown header inside a $$ ... $$ block. #17

@carlohamalainen

Description

@carlohamalainen

Hi,

This is more of a question than an issue.

I had a problem with a math block when I migrated from Jekyll to Hugo. A minimal example:

	input := `$$
P
=
Q
$$
`

P and Q were large matrices so I put them on separate lines.

Goldmark runs the block parsers first and the = is recognised as a header, so it renders to

<h1>$$
P</h1>
<p>Q
$$</p>

I guess this is an inherent limitation because passthrough is an inline parser? So even changing its priority wouldn't help because the block parsers run before the inline parsers?

adding block parser: *parser.setextHeadingParser
adding block parser: *parser.thematicBreakPraser
adding block parser: *parser.listParser
adding block parser: *parser.listItemParser
adding block parser: *parser.codeBlockParser
adding block parser: *parser.atxHeadingParser
adding block parser: *parser.fencedCodeBlockParser
adding block parser: *parser.blockquoteParser
adding block parser: *parser.htmlBlockParser
adding block parser: *parser.paragraphParser
adding inline parser: *parser.codeSpanParser
adding inline parser: *parser.linkParser
adding inline parser: *passthrough.inlinePassthroughParser
adding inline parser: *parser.autoLinkParser
adding inline parser: *parser.rawHTMLParser
adding inline parser: *parser.emphasisParser

An easy workaround is to indent the == by 4 spaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions