Skip to content

Commit

Permalink
fix #1819
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jun 13, 2015
1 parent 7ca4bf4 commit 5c2d116
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nikola/plugins/command/import_wordpress.py
Expand Up @@ -336,9 +336,13 @@ def transform_code(self, content):
# a ton of things not supported here. We only do a basic [code
# lang="x"] -> ```x translation, and remove quoted html entities (<,
# >, &, and ").
def replacement(m):
language = m.group(1) or ''
code = m.group(2)
def replacement(m, c=content):
if len(m.groups()) == 1:
language = ''
code = m.group(0)
else:
language = m.group(1) or ''
code = m.group(2)
code = code.replace('&amp;', '&')
code = code.replace('&gt;', '>')
code = code.replace('&lt;', '<')
Expand Down

0 comments on commit 5c2d116

Please sign in to comment.