aboutsummaryrefslogtreecommitdiffstats
path: root/markdown_extensions
diff options
context:
space:
mode:
authorYuri Takhteyev <yuri@freewisdom.org>2008-10-12 22:35:03 -0700
committerYuri Takhteyev <yuri@freewisdom.org>2008-10-12 22:35:03 -0700
commitf76b532c21be5ef95dbfbcee52bda3760587b7fc (patch)
tree8deb1f6b250799d76708086d6875aed9057529e6 /markdown_extensions
parent2d349a1f5dc4b55f2d2bcd7b9844d12ed0d31081 (diff)
downloadmarkdown-f76b532c21be5ef95dbfbcee52bda3760587b7fc.tar.gz
markdown-f76b532c21be5ef95dbfbcee52bda3760587b7fc.tar.bz2
markdown-f76b532c21be5ef95dbfbcee52bda3760587b7fc.zip
Incorporated Ben Wilson's Treap implementation.
Pre-processors, post-processors, patterns, etc. are now all stored in Treaps. We can then insert items between them with code like this: markdown.inlinePatterns.add("foo", FooPattern(), "<strong")
Diffstat (limited to 'markdown_extensions')
-rw-r--r--markdown_extensions/tables.py5
-rw-r--r--markdown_extensions/wikilinks.py6
2 files changed, 5 insertions, 6 deletions
diff --git a/markdown_extensions/tables.py b/markdown_extensions/tables.py
index 47c131b..c485f55 100644
--- a/markdown_extensions/tables.py
+++ b/markdown_extensions/tables.py
@@ -38,7 +38,6 @@ class TablePattern(markdown.Pattern) :
return tr
-
class TablePostprocessor:
def _findElement(self, element, name):
@@ -62,8 +61,8 @@ class TablePostprocessor:
class TableExtension(markdown.Extension):
def extendMarkdown(self, md, md_globals):
- md.inlinePatterns.insert(0, TablePattern(md))
- md.postprocessors.append(TablePostprocessor())
+ md.inlinePatterns.add('table', TablePattern(md), "<backtick")
+ md.postprocessors['table'] = TablePostprocessor()
def makeExtension(configs):
diff --git a/markdown_extensions/wikilinks.py b/markdown_extensions/wikilinks.py
index 4ecbd01..0d06100 100644
--- a/markdown_extensions/wikilinks.py
+++ b/markdown_extensions/wikilinks.py
@@ -89,9 +89,9 @@ class WikiLinkExtension (markdown.Extension) :
# append to end of inline patterns
WIKILINK_RE = r'\[\[([A-Za-z0-9_ -]+)\]\]'
- WIKILINK_PATTERN = WikiLinks(WIKILINK_RE, self.config)
- WIKILINK_PATTERN.md = md
- md.inlinePatterns.append(WIKILINK_PATTERN)
+ wikilinkPattern = WikiLinks(WIKILINK_RE, self.config)
+ wikilinkPattern.md = md
+ md.inlinePatterns.add('wikilink', wikilinkPattern, "_end")
class WikiLinks (markdown.BasePattern) :