From d35e73be19e00e8897c4c6acff5b5506b7235ae5 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 12 Feb 2013 09:47:17 -0500 Subject: Allow capitalized Admonition title. If an adminition title is capitalized, the html class on the div should still be lowercased. --- markdown/extensions/admonition.py | 2 +- tests/extensions/admonition.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown/extensions/admonition.py b/markdown/extensions/admonition.py index 798befb..122eb87 100644 --- a/markdown/extensions/admonition.py +++ b/markdown/extensions/admonition.py @@ -101,7 +101,7 @@ class AdmonitionProcessor(markdown.blockprocessors.BlockProcessor): blocks.insert(0, theRest) def get_class_and_title(self, match): - klass, title = match.group(1), match.group(2) + klass, title = match.group(1).lower(), match.group(2) if title is None: # no title was provided, use the capitalized classname as title # e.g.: `!!! note` will render `

Note

` diff --git a/tests/extensions/admonition.txt b/tests/extensions/admonition.txt index fd18bd6..b6c815c 100644 --- a/tests/extensions/admonition.txt +++ b/tests/extensions/admonition.txt @@ -16,7 +16,7 @@ Some text More text and stuff. -!!! note "Did you know?" +!!! Note "Did you know?" You can customize the title of the admonition !!! mycustomcssclass "And now..." -- cgit v1.2.3