summaryrefslogtreecommitdiff
path: root/markdown/extensions/admonition.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2017-03-05 14:51:00 -0500
committerWaylan Limberg <waylan.limberg@icloud.com>2017-03-05 14:54:18 -0500
commitfd4d1d2183b6f1f41445ba0461799da71adfb11a (patch)
tree88513cb525dabd2f3a421acd854ab98ee239e24c /markdown/extensions/admonition.py
parentab9f4c2dfb678c773387fe478f24bb59a0908e27 (diff)
downloadpython-markdown-fd4d1d2183b6f1f41445ba0461799da71adfb11a.tar.gz
Loosen whitespace requirements for admonitions.
Also consume to the end of the first line of any admonition. Everything after the title is discarded. However, the only thing that will match should be whitespace so it should be a non-issue. Fixes #550.
Diffstat (limited to 'markdown/extensions/admonition.py')
-rw-r--r--markdown/extensions/admonition.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py
index 76e0fb5..0c5ce46 100644
--- a/markdown/extensions/admonition.py
+++ b/markdown/extensions/admonition.py
@@ -41,7 +41,7 @@ class AdmonitionProcessor(BlockProcessor):
CLASSNAME = 'admonition'
CLASSNAME_TITLE = 'admonition-title'
- RE = re.compile(r'(?:^|\n)!!!\ ?([\w\-]+)(?:\ "(.*?)")?')
+ RE = re.compile(r'(?:^|\n)!!! ?([\w\-]+)(?: +"(.*?)")? *(?:\n|$)')
def test(self, parent, block):
sibling = self.lastChild(parent)
@@ -55,7 +55,7 @@ class AdmonitionProcessor(BlockProcessor):
m = self.RE.search(block)
if m:
- block = block[m.end() + 1:] # removes the first line
+ block = block[m.end():] # removes the first line
block, theRest = self.detab(block)