tag:support.markedapp.com,2011-09-11:/discussions/problems/146336-toc-bugMarked: Discussion 2018-04-12T21:26:30Ztag:support.markedapp.com,2011-09-11:Comment/450613122018-04-09T20:38:21Z2018-04-09T20:38:25ZTOC Bug???<div><p>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.</p>
<p>Attached is an MP4 that shows the issue.</p>
<p>This issue doesn't occur with all files; I have tried two files: one shows the issue; the other does not.</p></div>Carltag:support.markedapp.com,2011-09-11:Comment/450613122018-04-10T13:03:59Z2018-04-10T13:03:59ZTOC Bug???<div><p>Could you share the file that causes it to fail?</p>
<p>-Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/450613122018-04-10T15:16:01Z2018-04-10T15:16:01ZTOC Bug???<div><p>Hi Brett,</p>
<p>Yes, but it is loaded with notes from my work here at Facebook, so I have<br>
to trim it down to a minimal repro. I started on that yesterday, but it is<br>
a large file and I find that if I cut out certain parts of it, the problem<br>
goes away . . . :-P</p>
<p>I should have something for you tomorrow or Thursday.</p>
<p>Thanks for responding. Marked2 is a great product . . . I also enjoy your<br>
twitter feed BTW.</p>
<p>:: Carl</p></div>carljparkertag:support.markedapp.com,2011-09-11:Comment/450613122018-04-10T15:18:28Z2018-04-10T15:18:28ZTOC Bug???<div><p>Sure. All I'm interested in is what part of it is causing a JS error. If<br>
you know that removing a certain part fixes it, and loading just that<br>
certain part happens to reproduce it, you could just redact that part<br>
and send it to me. All I need is a way to replicate the issue.</p>
<p>Thanks!</p>
<p>Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/450613122018-04-12T15:13:51Z2018-04-12T15:13:53ZTOC Bug???<div><p>I've attached a minimal repro.</p>
<p>I think that the issue is my use of <tt>and/or <code>in running text<br>
before one of the headings . . . :-O</code></tt></p>
<p><tt><code>:: Carl</code></tt></p></div>carljparkertag:support.markedapp.com,2011-09-11:Comment/450613122018-04-12T20:35:25Z2018-04-12T20:35:25ZTOC Bug???<div><p>Yep, because both of those open up HTML tags that then encompass<br>
succeeding elements in the DOM because they're never closed. If you<br>
escape the angle brackets or wrap them in backticks, the problem should<br>
go away. This seems a reasonable solution since in their current format<br>
they wouldn't render as intended anyway.</p>
<p>Let me know if that's a satisfactory answer...</p>
<p>Thanks,<br>
Brett</p></div>Bretttag:support.markedapp.com,2011-09-11:Comment/450613122018-04-12T21:21:22Z2018-04-12T21:21:23ZTOC Bug???<div><p>Yes, that resolves the issue from my standpoint.</p>
<p>The only consideration though is that the nature of how the issue presents<br>
itself--that the TOC doesn't work correctly--doesn't really give any<br>
indication to the user where the real issue is.</p>
<p>But perhaps this issue occurs so rarely that just having this thread<br>
provides enough of a support trail to enable those who come after us to<br>
figure out quickly what is wrong.</p>
<p>Thanks for your help.</p>
<p>:: Carl</p></div>carljparkertag:support.markedapp.com,2011-09-11:Comment/450613122018-04-12T21:26:28Z2018-04-12T21:26:28ZTOC Bug???<div><p>It's a fair point, but because the TOC is generated from the DOM, the<br>
script itself has no concept of whether the DOM is rendering the<br>
original content correctly or not. It could fail more gracefully, yes,<br>
but it has to deal with almost <em>completely</em> unpredictable markup<br>
scenarios and in a lot of cases it doesn't appear as a failure so much<br>
as an index of invalid display elements. I'm just saying it's a tricky<br>
area when providing useful feedback :).</p>
<p>-Brett</p></div>Brett