From a017eff9d1782ddae7f100bf90911602be82b66a Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 6 Oct 2011 05:46:29 -0400 Subject: Fixed #44. The TOC extension will now except True/False in addition to 1/0 from the command line style syntax for passing in bool type extension configs. In order words, we now except strings in addition to booleans and integers. --- markdown/extensions/toc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/extensions/toc.py b/markdown/extensions/toc.py index 1f1de15..fb930e2 100644 --- a/markdown/extensions/toc.py +++ b/markdown/extensions/toc.py @@ -97,7 +97,7 @@ class TocTreeprocessor(markdown.treeprocessors.Treeprocessor): link.text = text link.attrib["href"] = '#' + id - if int(self.config["anchorlink"]): + if self.config["anchorlink"] in [1, '1', True, 'True', 'true']: anchor = etree.Element("a") anchor.text = c.text anchor.attrib["href"] = "#" + id -- cgit v1.2.3