aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/blockprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2018-07-27 10:55:41 -0400
committerGitHub <noreply@github.com>2018-07-27 10:55:41 -0400
commit25482261a494ad12c108435580ed13927bdc417c (patch)
tree5b108a5923322d5ceb3fa47d5f05d27a1039de7c /markdown/blockprocessors.py
parent55d69f408cfabed6bd5953a4e7bfc926df2ac25b (diff)
downloadmarkdown-25482261a494ad12c108435580ed13927bdc417c.tar.gz
markdown-25482261a494ad12c108435580ed13927bdc417c.tar.bz2
markdown-25482261a494ad12c108435580ed13927bdc417c.zip
All Markdown instances are now 'md'. (#691)
Previously, instances of the Markdown class were represented as any one of 'md', 'md_instance', or 'markdown'. This inconsistency made it difficult when developing extensions, or just maintaining the existing code. Now, all instances are consistently represented as 'md'. The old attributes on class instances still exist, but raise a DeprecationWarning when accessed. Also on classes where the instance was optional, the attribute always exists now and is simply None if no instance was provided (previously the attribute wouldn't exist).
Diffstat (limited to 'markdown/blockprocessors.py')
-rw-r--r--markdown/blockprocessors.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/markdown/blockprocessors.py b/markdown/blockprocessors.py
index 50c4591..009247c 100644
--- a/markdown/blockprocessors.py
+++ b/markdown/blockprocessors.py
@@ -22,9 +22,9 @@ from .blockparser import BlockParser
logger = logging.getLogger('MARKDOWN')
-def build_block_parser(md_instance, **kwargs):
+def build_block_parser(md, **kwargs):
""" Build the default block parser used by Markdown. """
- parser = BlockParser(md_instance)
+ parser = BlockParser(md)
parser.blockprocessors.register(EmptyBlockProcessor(parser), 'empty', 100)
parser.blockprocessors.register(ListIndentProcessor(parser), 'indent', 90)
parser.blockprocessors.register(CodeBlockProcessor(parser), 'code', 80)
@@ -51,7 +51,7 @@ class BlockProcessor(object):
def __init__(self, parser):
self.parser = parser
- self.tab_length = parser.markdown.tab_length
+ self.tab_length = parser.md.tab_length
def lastChild(self, parent):
""" Return the last child of an etree element. """
@@ -365,7 +365,7 @@ class OListProcessor(BlockProcessor):
# This is a new list so create parent with appropriate tag.
lst = util.etree.SubElement(parent, self.TAG)
# Check if a custom start integer is set
- if not self.parser.markdown.lazy_ol and self.STARTSWITH != '1':
+ if not self.parser.md.lazy_ol and self.STARTSWITH != '1':
lst.attrib['start'] = self.STARTSWITH
self.parser.state.set('list')