Marked not supporting alternate heading styles

Viewed 25

Using the alternate form for headings (=== or --- under the line) does not result in a header, and for the MultiMarkdown renderer, can cause formating down document to break. FWIW, Pandoc seems to be having trouble with this document as well.

Test case.md

Screenshot of similar document in VS Code, with Marked preview on the right.

Steps to reproduce:

  1. Create a heading with === instead of #

// Configuration (do not edit)
Marked 2 1071 (Setapp)
macOS Version: 26.2

additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: NO
convertGithubCheckboxes: YES
convertGithubEmoji: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 0
defaultProcessor: Discount (GFM)
enableMiniMap: NO
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: NO
includeKatex: NO
limitTextWidth: YES
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: NO
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft:
printHeaderTopRight:
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: YES
shouldDetectCritic: YES
shouldHighlightMarkupErrors: NO
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

3 Answers

The answer to this issue was that ==highlight== processing was enabled in Settings->Processor. This issue is resolved for Marked 3, but will be an issue on Marked 2 until I get a maintenance release out for it.

Your file renders the headline for me in both GFM and MultiMarkdown modes. I thought GitHub Newlines might have something to do with it, but that didn't allow me to reproduce the issue either.

Just out of curiousity, what editor are you editing the file in? Any chance the encoding is off or there are hidden characters happening on your end? I doubt it, as I used the raw file you uploaded for testing without making any modifications to it, but would be worth knowing.

Please hit ⌘U in Marked and show me what the HTML source looks like.

File was created in BBEdit 15.5.2, and edited in VS Code 1.107.1. UTF-8 with LF line endings. HTML below.

<p>Test case</p>

<p>=</p>

<ul>
<li>foo</li>
<li>bar

<ul>
<li>baz</li>
<li>qux</li>
</ul>
</li>
</ul>

Side note: clicking "Open Support Site" in the "Report an issue" dialogue results in a 404.

Thanks for looking in to this!

Does anything change if you add or remove an = from the Setext row? It's so weird that it's narrowing it down to 1 = character and treating it as a paragraph. If anything, if it weren't processing Setext headers, it would make the ==== part of the preceding paragraph.

Do you have rendering of ==higlight== text enabled in Processor settings?

Does anything change if you add or remove an = from the Setext row?

Kind of. It would render a hard rule at different lengths.

Do you have rendering of ==higlight== text enabled in Processor settings?

I did, and that was it! Thank you!