aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/inlinepatterns.py
diff options
context:
space:
mode:
authorIsaac Muse <faceless.shop@gmail.com>2017-11-23 07:56:38 -0700
committerWaylan Limberg <waylan.limberg@icloud.com>2017-11-23 09:56:38 -0500
commitde5c696f94e8dde242c29d4be50b7bbf3c17fedb (patch)
tree31c6c11b698be4b284c9b93b05a4d0ca3bd58e6a /markdown/inlinepatterns.py
parent007bd2aa4c184b28f710d041a0abe78bffc0ec2e (diff)
downloadmarkdown-de5c696f94e8dde242c29d4be50b7bbf3c17fedb.tar.gz
markdown-de5c696f94e8dde242c29d4be50b7bbf3c17fedb.tar.bz2
markdown-de5c696f94e8dde242c29d4be50b7bbf3c17fedb.zip
Feature ancestry (#598)
Ancestry exclusion for inline patterns. Adds the ability for an inline pattern to define a list of ancestor tag names that should be avoided. If a pattern would create a descendant of one of the listed tag names, the pattern will not match. Fixes #596.
Diffstat (limited to 'markdown/inlinepatterns.py')
-rw-r--r--markdown/inlinepatterns.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py
index 3658ebd..2f00b3d 100644
--- a/markdown/inlinepatterns.py
+++ b/markdown/inlinepatterns.py
@@ -189,6 +189,8 @@ The pattern classes
class Pattern(object):
"""Base class that inline patterns subclass. """
+ ANCESTOR_EXCLUDES = tuple()
+
def __init__(self, pattern, markdown_instance=None):
"""
Create an instant of an inline pattern.