Skip to content
Permalink
Browse files

Fix #2939 -- don’t run hyphenate on <pre> blocks

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Dec 29, 2017
1 parent 6715f8d commit df7207c10a50c54425b6537c8bc72cc8ff1c7240
Showing with 2 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +1 −1 nikola/post.py
@@ -28,6 +28,7 @@ Features
Bugfixes
--------

* Don’t run hyphenate on ``<pre>`` blocks (Issue #2939)
* Make errors in reST display in logs again
* Unquote paths given to ``link://`` magic URLs (Issue #2934)
* Specify UTF-8 input encoding for Mako as default (Issue #2930)
@@ -1076,7 +1076,7 @@ def hyphenate(dom, _lang):
for tag in ('p', 'li', 'span'):
for node in dom.xpath("//%s[not(parent::pre)]" % tag):
skip_node = False
skippable_nodes = ['kbd', 'code', 'samp', 'mark', 'math', 'data', 'ruby', 'svg']
skippable_nodes = ['kbd', 'pre', 'code', 'samp', 'mark', 'math', 'data', 'ruby', 'svg']
if node.getchildren():
for child in node.getchildren():
if child.tag in skippable_nodes or (child.tag == 'span' and 'math'

0 comments on commit df7207c

Please sign in to comment.