diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2014-12-30 13:58:58 -0500 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2014-12-30 13:58:58 -0500 |
commit | 49fa23af8141f7c5665e2e8633ad425cd823dfec (patch) | |
tree | 66bf2bbc9a12578dac6db8e97672838ad92a4833 /tests/extensions/toc_nested_list.html | |
parent | 86ca8ce1eb316f796d9a3e8e70da0ad844a89f48 (diff) | |
download | markdown-49fa23af8141f7c5665e2e8633ad425cd823dfec.tar.gz markdown-49fa23af8141f7c5665e2e8633ad425cd823dfec.tar.bz2 markdown-49fa23af8141f7c5665e2e8633ad425cd823dfec.zip |
Preserve order of nested headers in TOC
Fixes #380. The TOC replacement is now seperate from building the
TOC, which allows us to iter through the doc in order rather than
with the non-order-preserving interparent pethod. This is almost a
complete refactor of the run method. Also cleaned up the config stuff.
Thanks to @colewerner for the report and test case.
Diffstat (limited to 'tests/extensions/toc_nested_list.html')
-rw-r--r-- | tests/extensions/toc_nested_list.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/extensions/toc_nested_list.html b/tests/extensions/toc_nested_list.html new file mode 100644 index 0000000..6912411 --- /dev/null +++ b/tests/extensions/toc_nested_list.html @@ -0,0 +1,30 @@ +<h1 id="title">Title</h1> +<div class="toc"> +<ul> +<li><a href="#title">Title</a><ul> +<li><a href="#section-1">Section 1</a><ul> +<li><a href="#subsection-1">Subsection 1</a></li> +<li><a href="#subsection-2">Subsection 2</a></li> +</ul> +</li> +<li><a href="#section-2">Section 2</a></li> +<li><a href="#section-3">Section 3</a></li> +</ul> +</li> +</ul> +</div> +<h2 id="section-1">Section 1</h2> +<ol> +<li> +<p>List Item 1</p> +<h3 id="subsection-1">Subsection 1</h3> +<p>Explanation 1</p> +</li> +<li> +<p>List Item 2</p> +<h3 id="subsection-2">Subsection 2</h3> +<p>Explanation 2</p> +</li> +</ol> +<h2 id="section-2">Section 2</h2> +<h2 id="section-3">Section 3</h2>
\ No newline at end of file |