When a heading includes angle brackets, the generated text in the TOC does not include character entities (< and >), but actual angle brackets, which turn it into an actual HTML tag.

For example, I have this as a heading:

<video> tag

In the TOC, this appears as an actual video tag. (I can't type that here, so here's an image a link to an image.)

https://www.flickr.com/photos/sagipolley/27949436364/

Which kinda screws up the TOC :)

Comments

martinpolley created an issue. See original summary.

will_c’s picture

-removed-

robert castelo’s picture

Status: Active » Closed (works as designed)

Put the angle brackets in your content as a HTML characters.

TOC Node will not convert angle brackets because it's sometimes useful to add HTML tags like span around words of a title and we don't want the showing up in the TOC.

laurelstreng’s picture

So i've actually been trying to use HTML entities to show header tags, and TOC Node is not converting them. Instead of showing <h2> in the TOC, it's actually creating a header 2 html tag.

My source code is:
<h2>Header Tags &lt;h2&gt; -- &lt;h6&gt; OR XML &lt;fnord&gt;thruth&lt;/fnord&gt;&nbsp; Empty &lt;&gt;&nbsp;Finally, one angle &lt;</h2>

And what I get from TOC is:
<span class="toc-number">2</span> <span class="toc-text">Header Tags <h2> -- </h2></span></a><h6><a href="/wiki/responsive-web-test-case-5-header-tags#toc-3"> OR XML <fnord>thruth</fnord>&nbsp; Empty &lt;&gt;&nbsp;Finally, one angle &lt;</a></h6>

laurelstreng’s picture

Status: Closed (works as designed) » Active