Code block rendering bug -- replaced by something later in the document!

Alex Chan's Avatar

Alex Chan

29 Nov, 2018 02:24 PM

// Please enter a detailed description of the issue // Description of the issue:

In certain cases, a code block can be rendered as the
last valid code block in the document, not with its
actual contents.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

Attached is a ZIP file containing a document which exhibits the issue, and
a screenshot of the rendered output.

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 964 (Direct)

macOS Version: 10.12.6

allowPageBreakInCode: TRUE
bookTxtIsLeanpub: TRUE
summaryMdIsGitBook: TRUE
codeIsPoetry: TRUE
codeCanWrap: TRUE
collapsibleHeadlines: TRUE
convertGithubCheckboxes: TRUE
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 0
defaultProcessor: MultiMarkdown
enableMiniMap: TRUE
excludeBlockQuotesFromCounts: TRUE
excludeFootnotesFromCounts: TRUE
excludeVerbatimFromCounts: TRUE
excludeCaptionsFromCounts: TRUE
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: TRUE
h1IsPageBreak: TRUE
h2IsPageBreak: TRUE
hrIsPageBreak: TRUE
includeMathJax: TRUE
limitTextWidth: TRUE
minimalJavaScript: TRUE
permissionGranted: TRUE
printHeaderFirstPage: TRUE
printFooterFirstPage: TRUE
processHTMLFiles: TRUE
removeMetadataForPreview: TRUE
removeYAMLHeaders: TRUE
scrollToEdit: TRUE
shouldDetectCritic: TRUE
shouldHighlightMarkupErrors: TRUE
shouldLoadCritic: TRUE
syntaxHighlight: TRUE
syntaxHighlightOnlyLang: NO

  1. Support Staff 1 Posted by Brett on 30 Nov, 2018 04:04 PM

    Brett's Avatar

    Definitely an odd bug, and apparently specific to the GFM processor.
    Interestingly, outdenting the first code block so that it's even with
    the first paragraph of the list item does seem to fix the issue, partly
    because the way you had it indented created a fenced code block inside
    of an indented code block.

    I'll look into it further, but fixing indentation does solve it for the
    immediate present.


  2. 2 Posted by Alex Chan on 30 Nov, 2018 11:25 PM

    Alex Chan's Avatar

    Ah, so the intention wasn’t to create a fenced code block inside an indented code block – it was to create a code block that was indented to line up with a list element.

    I was creating something a bit like this:

    I originally wrote the Markdown in a GitHub pull request comment, copied the raw Markdown to a local file, and opened it in Marked. The GitHub editor doesn’t seem to be as strict about indentation and rendered it as intended.

    And just to be clear: I absolutely view this as “weird edge-case bug that doesn’t merit lots of investigation”. I reported it because I know I’d want to know, and it might be useful in tracking down a bigger bug, but not because it’s breaking my workflow or anything.


  3. Support Staff 3 Posted by Brett on 01 Dec, 2018 04:08 PM

    Brett's Avatar

    Cool. It's a weird enough bug that I'm interested in tracking it down as the resources to do so become available :)


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • 49.4 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac