<details? in GFM (discount)

Er-c's Avatar


16 Sep, 2016 09:24 PM


Not sure if my Marked2 is just configured improperly, so gonna ask here before I file a bug report.

When using the...

    <summary>Hello World</summary>

code blocks inside of here are somewhat broken


...this style of markdown works in GFM (at least on github itself)

It only sorta works in Marked2

I have attached an image to show the issue.
Basically, the code block doesn't expand properly if nested in that details element

If I toggle the export drawer, it temporarily fixes this.

  1. Support Staff 1 Posted by Brett on 17 Sep, 2016 02:11 PM

    Brett's Avatar

    I'm curious about the rest of your settings. I'm not seeing this
    behavior locally: http://ckyp.us/nG3h

    Please go to Help->Report an issue and copy out the settings you see
    there to paste into this discussion. If possible, also attach a Markdown
    file that demonstrates the issue for you.


  2. Support Staff 2 Posted by Brett on 17 Sep, 2016 03:54 PM

    Brett's Avatar

    I did find some odd behavior when there is content following the nested code block. This is because as a part of syntax highlighting, Marked measures pre/code blocks on the page and maintains their size during resize and theme changes. When the code block is visible in the dom but hidden by the HTML, the measurements are skewed. I'll look into add an event handler for detail blocks opening and correct sizes on expansion.

    In the meantime, it would be possible to just add the open param to the detail blocks while writing (<details open>) to circumvent, or add a quick JavaScript to the document that added it, and then remove that when publishing.

    Inserting this at the end of the document opens all details nodes automatically.

    nodes = document.querySelectorAll('details');
    for (n in nodes) { nodes[n].open = true; }

Reply to this discussion

Internal reply

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

Attaching KB article:


Already uploaded files

  • Screen_Shot_2016-09-16_at_5.21.35_PM.png 41.2 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