aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extensions-x-toc
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2009-07-21 20:56:49 -0400
committerWaylan Limberg <waylan@gmail.com>2009-07-21 20:56:49 -0400
commit93dddf9eb7b3263beda332e79ee84cf8ab9c13bb (patch)
tree2fa660b1e9c7eaaa6e47410d1e7cc080535970c4 /tests/extensions-x-toc
parentc38f1813a1c2d7c531517a74c456166af92356b4 (diff)
downloadmarkdown-93dddf9eb7b3263beda332e79ee84cf8ab9c13bb.tar.gz
markdown-93dddf9eb7b3263beda332e79ee84cf8ab9c13bb.tar.bz2
markdown-93dddf9eb7b3263beda332e79ee84cf8ab9c13bb.zip
Fixed TOC extension to properly nest multiple header levels in the table of contents. Specificly, when stepping back multiple levels, the nestsed listed now follow suite. Test included. Thanks for the patch Jack Miller.
Diffstat (limited to 'tests/extensions-x-toc')
-rw-r--r--tests/extensions-x-toc/nested.html16
-rw-r--r--tests/extensions-x-toc/nested.txt9
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/extensions-x-toc/nested.html b/tests/extensions-x-toc/nested.html
new file mode 100644
index 0000000..a8a1583
--- /dev/null
+++ b/tests/extensions-x-toc/nested.html
@@ -0,0 +1,16 @@
+<h1 id="header-a">Header A</h1>
+<h2 id="header-1">Header 1</h2>
+<h3 id="header-i">Header i</h3>
+<h1 id="header-b">Header B</h1>
+<div class="toc">
+<ul>
+<li><a href="#header-a">Header A</a><ul>
+<li><a href="#header-1">Header 1</a><ul>
+<li><a href="#header-i">Header i</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#header-b">Header B</a></li>
+</ul>
+</div> \ No newline at end of file
diff --git a/tests/extensions-x-toc/nested.txt b/tests/extensions-x-toc/nested.txt
new file mode 100644
index 0000000..9b515f9
--- /dev/null
+++ b/tests/extensions-x-toc/nested.txt
@@ -0,0 +1,9 @@
+# Header A
+
+## Header 1
+
+### Header i
+
+# Header B
+
+[TOC]