Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 df7207c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nikola/post.py
Expand Up @@ -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'
Expand Down

0 comments on commit df7207c

Please sign in to comment.