From 6c36687b250e404ac4f8525126b0a7b70bc7036c Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 19 Feb 2013 16:30:51 -0500 Subject: More TOC cleanup and added tests. --- markdown/extensions/toc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py index e31aa2b..7edc0cc 100644 --- a/markdown/extensions/toc.py +++ b/markdown/extensions/toc.py @@ -172,10 +172,10 @@ class TocTreeprocessor(markdown.treeprocessors.Treeprocessor): toc_list_nested = order_toc_list(toc_list) self.build_toc_etree(div, toc_list_nested) + prettify = self.markdown.treeprocessors.get('prettify') + if prettify: prettify.run(div) if not marker_found: # serialize and attach to markdown instance. - prettify = self.markdown.treeprocessors.get('prettify') - if prettify: prettify.run(div) toc = self.markdown.serializer(div) for pp in self.markdown.postprocessors.values(): toc = pp.run(toc) -- cgit v1.2.3