aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Serafim <tserafim@gmail.com>2012-09-19 19:42:00 -0300
committerTiago Serafim <tserafim@gmail.com>2012-09-19 19:42:00 -0300
commit6c15c64df40b9ded3f5dea2e694905222791c1b6 (patch)
tree1a12d856ce4ccebb96ddec280d87e2a0824ebd4f
parent85e74fb710e64a35b3ed458bdec6cfed7827c3b1 (diff)
downloadmarkdown-6c15c64df40b9ded3f5dea2e694905222791c1b6.tar.gz
markdown-6c15c64df40b9ded3f5dea2e694905222791c1b6.tar.bz2
markdown-6c15c64df40b9ded3f5dea2e694905222791c1b6.zip
Added comments detailing the difference between not providing a title and using a blank string as a title
-rw-r--r--markdown/extensions/admonition.py4
1 files changed, 4 insertions, 0 deletions
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 `<p class="admonition-title">Note</p>`
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