diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2014-08-29 14:11:57 -0400 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2014-08-29 14:11:57 -0400 |
commit | 9d388a8ee26934c7b4685374ed7afbf5219d1995 (patch) | |
tree | 0868a64d464fdb16d708fe862c0608ad8e946200 /markdown/extensions/headerid.py | |
parent | c27cbd154050c1181eac195a4b0bb19a6bbaf048 (diff) | |
download | python-markdown-9d388a8ee26934c7b4685374ed7afbf5219d1995.tar.gz |
More updates to test configs.
The last few extensions were updated to accept dicts/**kwargs as configs and more
tests were updated. Also updated extra to actually accept configs.
Note that extra requires an extra level of dicts. First you need
to indicate tha the settings are for extra, then, which extension
extra wraps. I'm not crazy abount this, bit not sur ehow else to do it
without making all the configs a global attribute on the Markdown class
to that any extention can access any other extensions config settings.
I don't think we wnat to do that.
Also updated extra to use dot notation for the sub-extensions.
Diffstat (limited to 'markdown/extensions/headerid.py')
-rw-r--r-- | markdown/extensions/headerid.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py index 9af94df..f7b7805 100644 --- a/markdown/extensions/headerid.py +++ b/markdown/extensions/headerid.py @@ -117,7 +117,7 @@ class HeaderIdTreeprocessor(Treeprocessor): class HeaderIdExtension(Extension): - def __init__(self, configs): + def __init__(self, *args, **kwargs): # set defaults self.config = { 'level' : ['1', 'Base level for headers.'], @@ -126,8 +126,7 @@ class HeaderIdExtension(Extension): 'slugify' : [slugify, 'Callable to generate anchors'], } - for key, value in configs: - self.setConfig(key, value) + super(HeaderIdExtension, self).__init__(*args, **kwargs) def extendMarkdown(self, md, md_globals): md.registerExtension(self) |