diff options
author | Waylan Limberg <waylan@gmail.com> | 2011-10-06 05:46:29 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2011-10-06 05:49:02 -0400 |
commit | a017eff9d1782ddae7f100bf90911602be82b66a (patch) | |
tree | 14385316e476355d8e8dff16756a60db16f5758e | |
parent | 7f9d9e156163d5da65b13e0e59187a3a58221c2e (diff) | |
download | markdown-a017eff9d1782ddae7f100bf90911602be82b66a.tar.gz markdown-a017eff9d1782ddae7f100bf90911602be82b66a.tar.bz2 markdown-a017eff9d1782ddae7f100bf90911602be82b66a.zip |
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.
-rw-r--r-- | markdown/extensions/toc.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |