aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/treeprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2018-07-31 14:12:49 -0400
committerGitHub <noreply@github.com>2018-07-31 14:12:49 -0400
commit1e7fd3f236f63f9ca9b85de9cd172b77e7f9be80 (patch)
tree480f31abf71a8c205d04f961478fd579680b570f /markdown/treeprocessors.py
parent7dad12c07e3e701da42474696398cb32e5c9979f (diff)
downloadmarkdown-1e7fd3f236f63f9ca9b85de9cd172b77e7f9be80.tar.gz
markdown-1e7fd3f236f63f9ca9b85de9cd172b77e7f9be80.tar.bz2
markdown-1e7fd3f236f63f9ca9b85de9cd172b77e7f9be80.zip
Move isBlockLevel to class. (#693)
Allows users and/or extensions to alter the list of block level elements. The old implementation remains with a DeprecationWarning. Fixes #575.
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r--markdown/treeprocessors.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py
index 353826e..5c2be2d 100644
--- a/markdown/treeprocessors.py
+++ b/markdown/treeprocessors.py
@@ -406,12 +406,12 @@ class PrettifyTreeprocessor(Treeprocessor):
""" Recursively add linebreaks to ElementTree children. """
i = "\n"
- if util.isBlockLevel(elem.tag) and elem.tag not in ['code', 'pre']:
+ if self.md.is_block_level(elem.tag) and elem.tag not in ['code', 'pre']:
if (not elem.text or not elem.text.strip()) \
- and len(elem) and util.isBlockLevel(elem[0].tag):
+ and len(elem) and self.md.is_block_level(elem[0].tag):
elem.text = i
for e in elem:
- if util.isBlockLevel(e.tag):
+ if self.md.is_block_level(e.tag):
self._prettifyETree(e)
if not elem.tail or not elem.tail.strip():
elem.tail = i