aboutsummaryrefslogtreecommitdiffstats
path: root/markdown
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2013-02-19 11:00:38 -0500
committerWaylan Limberg <waylan@gmail.com>2013-02-19 11:00:38 -0500
commite5e07c3746358fc70afc2e5b0344a5e7573b444a (patch)
tree5124591a538876a7a1f9eea31a3eb39b5cde5ad8 /markdown
parent53a7fc80f12cc1da699c2a7f56da13da32e6de8f (diff)
downloadmarkdown-e5e07c3746358fc70afc2e5b0344a5e7573b444a.tar.gz
markdown-e5e07c3746358fc70afc2e5b0344a5e7573b444a.tar.bz2
markdown-e5e07c3746358fc70afc2e5b0344a5e7573b444a.zip
Ensure toc attribute is available on Markdown class.
This appears to have recently been broken with the fixes in #191. This time I've added tests to prevent future breakage and added documentation to explain the behavior.
Diffstat (limited to 'markdown')
-rw-r--r--markdown/extensions/toc.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py
index 173ae17..580d77e 100644
--- a/markdown/extensions/toc.py
+++ b/markdown/extensions/toc.py
@@ -170,9 +170,9 @@ class TocTreeprocessor(markdown.treeprocessors.Treeprocessor):
self.add_anchor(c, elem_id)
- if marker_found:
- toc_list_nested = order_toc_list(toc_list)
- self.build_toc_etree(div, toc_list_nested)
+ toc_list_nested = order_toc_list(toc_list)
+ self.build_toc_etree(div, toc_list_nested)
+ if not marker_found:
# serialize and attach to markdown instance.
prettify = self.markdown.treeprocessors.get('prettify')
if prettify: prettify.run(div)