From 6c15c64df40b9ded3f5dea2e694905222791c1b6 Mon Sep 17 00:00:00 2001 From: Tiago Serafim Date: Wed, 19 Sep 2012 19:42:00 -0300 Subject: Added comments detailing the difference between not providing a title and using a blank string as a title --- markdown/extensions/admonition.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py index 0f6af80..798befb 100644 --- a/markdown/extensions/admonition.py +++ b/markdown/extensions/admonition.py @@ -103,8 +103,12 @@ class AdmonitionProcessor(markdown.blockprocessors.BlockProcessor): def get_class_and_title(self, match): klass, title = match.group(1), match.group(2) if title is None: + # no title was provided, use the capitalized classname as title + # e.g.: `!!! note` will render `

Note

` title = klass.capitalize() elif title == '': + # an explicit blank title should not be rendered + # e.g.: `!!! warning ""` will *not* render `p` with a title title = None return klass, title -- cgit v1.2.3