Skip to content

Commit 3c2c9c6

Browse files
committed
Don't rely on toc-end comment
1 parent 5a1b241 commit 3c2c9c6

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

scripts/md2html/md2html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ for (let l in lines) {
190190

191191
// remove TOC from older spec versions, respec will generate a new one
192192
if (line.startsWith('## Table of Contents')) inTOC = true;
193-
if (line.startsWith('<!-- /TOC')) inTOC = false;
193+
else if (line.startsWith('#')) inTOC = false;
194194
if (inTOC) line = '';
195195

196196
// special formatting for Definitions section

tests/md2html/fixtures/basic-old.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<p>Text for first chapter</p>
44
<section class="override" id="conformance"><h2>Version 30.0.1</h2>
55
<p>This is the conformance section</p>
6-
<!-- /TOC -->
76
</section></section><section><h1>Heading 2</h1>
87
<p>Text for first section</p>
98
<p><span id="parameterAllowEmptyValue"></span>Broken anchor</p>

tests/md2html/fixtures/basic-old.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ This is the conformance section
1010

1111
Will be removed
1212

13-
<!-- /TOC -->
14-
1513
## Heading 2
1614

1715
Text for first section

0 commit comments

Comments
 (0)