chiark / gitweb /
m.htmlsanity: produce ­ instead of U+00AD in the hyphenate filter.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 8 Sep 2017 09:34:48 +0000 (11:34 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 12 Sep 2017 10:06:26 +0000 (12:06 +0200)
Makes the result easier to spot in the resulting HTML code.

pelican-plugins/m/htmlsanity.py

index 95e7eb2ad45696e32e70f5de278c4d8a26e98ca5..69605c63dba746065faa3393c13cd2fceee5fd2e 100644 (file)
@@ -469,7 +469,7 @@ def hyphenate(value, enable=None, lang=None):
     if lang is None: lang = hyphenation_lang
     if not enable: return value
     pyphen_ = pyphen.Pyphen(lang=lang)
-    return words_re.sub(lambda m: pyphen_.inserted(m.group(0), '\u00AD'), str(value))
+    return words_re.sub(lambda m: pyphen_.inserted(m.group(0), '&shy;'), str(value))
 
 def configure_pelican(pelicanobj):
     pelicanobj.settings['JINJA_FILTERS']['render_rst'] = render_rst