diff options
Diffstat (limited to 'markdown/extensions/wikilinks.py')
-rw-r--r-- | markdown/extensions/wikilinks.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/markdown/extensions/wikilinks.py b/markdown/extensions/wikilinks.py index 6d34173..c2aab8f 100644 --- a/markdown/extensions/wikilinks.py +++ b/markdown/extensions/wikilinks.py @@ -90,19 +90,17 @@ def build_url(label, base, end): class WikiLinkExtension(Extension): - def __init__(self, configs): - # set extension defaults + + def __init__ (self, *args, **kwargs): self.config = { - 'base_url' : ['/', 'String to append to beginning or URL.'], - 'end_url' : ['/', 'String to append to end of URL.'], - 'html_class' : ['wikilink', 'CSS hook. Leave blank for none.'], - 'build_url' : [build_url, 'Callable formats URL from label.'], + 'base_url' : ['/', 'String to append to beginning or URL.'], + 'end_url' : ['/', 'String to append to end of URL.'], + 'html_class' : ['wikilink', 'CSS hook. Leave blank for none.'], + 'build_url' : [build_url, 'Callable formats URL from label.'], } - configs = dict(configs) or {} - # Override defaults with user settings - for key, value in configs.items(): - self.setConfig(key, value) + super(WikiLinkExtension, self).__init__(*args, **kwargs) + def extendMarkdown(self, md, md_globals): self.md = md @@ -147,5 +145,5 @@ class WikiLinks(Pattern): return base_url, end_url, html_class -def makeExtension(configs=None) : - return WikiLinkExtension(configs=configs) +def makeExtension(*args, **kwargs) : + return WikiLinkExtension(*args, **kwargs) |