Skip to content
Permalink
Browse files
fix #1819
  • Loading branch information
ralsina committed Jun 13, 2015
1 parent 7ca4bf4 commit 5c2d116c8334e77f278094e3f0037ae73c2c99cd
Showing with 7 additions and 3 deletions.
  1. +7 −3 nikola/plugins/command/import_wordpress.py
@@ -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;', '<')

0 comments on commit 5c2d116

Please sign in to comment.