aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/blockparser.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2010-07-06 16:30:11 -0400
committerWaylan Limberg <waylan@gmail.com>2010-07-06 16:30:11 -0400
commit018aa73e82941288a1178ded751cf29d9bc13581 (patch)
tree38a87c7f51eddf389fb0455c112e7bbb6bbf448a /markdown/blockparser.py
parent03bf339b594db40592d3a4848ec1e5402a371df2 (diff)
downloadmarkdown-018aa73e82941288a1178ded751cf29d9bc13581.tar.gz
markdown-018aa73e82941288a1178ded751cf29d9bc13581.tar.bz2
markdown-018aa73e82941288a1178ded751cf29d9bc13581.zip
Moved a bunch of global variables to the instance of the Markdown class.
Diffstat (limited to 'markdown/blockparser.py')
-rw-r--r--markdown/blockparser.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/markdown/blockparser.py b/markdown/blockparser.py
index afbdabd..533b695 100644
--- a/markdown/blockparser.py
+++ b/markdown/blockparser.py
@@ -42,9 +42,10 @@ class BlockParser:
looping through them and creating an ElementTree object.
"""
- def __init__(self):
+ def __init__(self, markdown):
self.blockprocessors = odict.OrderedDict()
self.state = State()
+ self.markdown = markdown
def parseDocument(self, lines):
""" Parse a markdown document into an ElementTree.
@@ -57,7 +58,7 @@ class BlockParser:
"""
# Create a ElementTree from the lines
- self.root = util.etree.Element(util.DOC_TAG)
+ self.root = util.etree.Element(self.markdown.DOC_TAG)
self.parseChunk(self.root, '\n'.join(lines))
return util.etree.ElementTree(self.root)