TOC Bug???

Carl's Avatar


09 Apr, 2018 08:38 PM

I am seeing an issue on Marked2 v2.5.10 in which, when I try to toggle the TOC--using either cmd-t or clicking the TOC icons--only a dark-colored header pops up. At this point, the only way to get this UI artifact to go away is cmd-r (refresh); neither cmd-t or clicking the TOC control has any effect.

Attached is an MP4 that shows the issue.

This issue doesn't occur with all files; I have tried two files: one shows the issue; the other does not.

  1. Support Staff 1 Posted by Brett on 10 Apr, 2018 01:03 PM

    Brett's Avatar

    Could you share the file that causes it to fail?


  2. 2 Posted by carljparker on 10 Apr, 2018 03:16 PM

    carljparker's Avatar

    Hi Brett,

    Yes, but it is loaded with notes from my work here at Facebook, so I have
    to trim it down to a minimal repro. I started on that yesterday, but it is
    a large file and I find that if I cut out certain parts of it, the problem
    goes away . . . :-P

    I should have something for you tomorrow or Thursday.

    Thanks for responding. Marked2 is a great product . . . I also enjoy your
    twitter feed BTW.

    :: Carl

  3. Support Staff 3 Posted by Brett on 10 Apr, 2018 03:18 PM

    Brett's Avatar

    Sure. All I'm interested in is what part of it is causing a JS error. If
    you know that removing a certain part fixes it, and loading just that
    certain part happens to reproduce it, you could just redact that part
    and send it to me. All I need is a way to replicate the issue.



  4. 4 Posted by carljparker on 12 Apr, 2018 03:13 PM

    carljparker's Avatar

    I've attached a minimal repro.

    I think that the issue is my use of <tt> and/or <code> in running text
    before one of the headings . . . :-O

    :: Carl

  5. Support Staff 5 Posted by Brett on 12 Apr, 2018 08:35 PM

    Brett's Avatar

    Yep, because both of those open up HTML tags that then encompass
    succeeding elements in the DOM because they're never closed. If you
    escape the angle brackets or wrap them in backticks, the problem should
    go away. This seems a reasonable solution since in their current format
    they wouldn't render as intended anyway.

    Let me know if that's a satisfactory answer...


  6. 6 Posted by carljparker on 12 Apr, 2018 09:21 PM

    carljparker's Avatar

    Yes, that resolves the issue from my standpoint.

    The only consideration though is that the nature of how the issue presents
    itself--that the TOC doesn't work correctly--doesn't really give any
    indication to the user where the real issue is.

    But perhaps this issue occurs so rarely that just having this thread
    provides enough of a support trail to enable those who come after us to
    figure out quickly what is wrong.

    Thanks for your help.

    :: Carl

  7. Support Staff 7 Posted by Brett on 12 Apr, 2018 09:26 PM

    Brett's Avatar

    It's a fair point, but because the TOC is generated from the DOM, the
    script itself has no concept of whether the DOM is rendering the
    original content correctly or not. It could fail more gracefully, yes,
    but it has to deal with almost _completely_ unpredictable markup
    scenarios and in a lot of cases it doesn't appear as a failure so much
    as an index of invalid display elements. I'm just saying it's a tricky
    area when providing useful feedback :).


Reply to this discussion

Internal reply

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

Attaching KB article:


Already uploaded files

  • 2018-04-09_13-13-41.mp4 2.09 MB

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