Fix numeric entities--correctly this time. Reduce margins slightly, tweak description escaping slightly.

This commit is contained in:
retiefjimm
2010-11-18 14:26:16 -06:00
parent e3b4769bfb
commit 9b6fdb4540
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
CSS = '''body { margin-left: 5%; margin-right: 5%; margin-top: 5%; margin-bottom: 5%; text-align: justify; }
CSS = '''body { margin-left: 2%; margin-right: 2%; margin-top: 2%; margin-bottom: 2%; text-align: justify; }
pre { font-size: x-small; }
sml { font-size: small; }
h1 { text-align: center; }
+4 -5
View File
@@ -243,8 +243,8 @@ class EPubFanficWriter(FanficWriter):
else:
description = str(description)
if description is not None and len(description) > 0:
description = description.replace ('\\\'', '').replace('\\\"', '')
description = removeEntities(description.replace(' ',' ').replace('’',''))
description = description.replace ('\\', '\'').replace('\\\"', '\"')
description = removeEntities(description)
else:
description = ' '
@@ -336,12 +336,11 @@ class EPubFanficWriter(FanficWriter):
def unirepl(match):
"Return the unicode string for a decimal number"
s = match.group()
if s[2].lower()=='x':
if match.group(1)=='x':
radix=16
else:
radix=10
value = int(s[3:-1], radix )
value = int(match.group(2), radix )
return unichr(value)
def replaceNumberEntities(data):