aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-04-28 21:48:42 -0400
committerWaylan Limberg <waylan@gmail.com>2011-04-28 21:48:42 -0400
commitc042da8ab693f981f4e0a2b0bded23a55b3b923f (patch)
tree3187ce2691420bf98fbb7090daedbaa893699a12
parent8c46de40ce949971c3a887f5ff9bf0da1a610d22 (diff)
downloadmarkdown-c042da8ab693f981f4e0a2b0bded23a55b3b923f.tar.gz
markdown-c042da8ab693f981f4e0a2b0bded23a55b3b923f.tar.bz2
markdown-c042da8ab693f981f4e0a2b0bded23a55b3b923f.zip
Corrected behavior of headerid extension to match default behavior when "Weve got a problem header". We log a warning - not raise an exception.
-rw-r--r--markdown/extensions/headerid.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py
index 6d64a43..390a8ba 100644
--- a/markdown/extensions/headerid.py
+++ b/markdown/extensions/headerid.py
@@ -69,6 +69,9 @@ import markdown
from markdown.util import etree
import re
from string import ascii_lowercase, digits, punctuation
+import logging
+
+logger = logging.getLogger('MARKDOWN')
ID_CHARS = ascii_lowercase + digits + '-_'
IDCOUNT_RE = re.compile(r'^(.*)_([0-9]+)$')
@@ -119,7 +122,7 @@ class HeaderIdProcessor(markdown.blockprocessors.BlockProcessor):
blocks.insert(0, after)
else:
# This should never happen, but just in case...
- raise ValueError("Encountered a problem header: %r" % block)
+ logger.warn("We've got a problem header: %r" % block)
def _get_meta(self):
""" Return meta data suported by this ext as a tuple """