mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-09-13 12:11:20 +08:00
Fix numeric entities--correctly this time. Reduce margins slightly, tweak description escaping slightly.
This commit is contained in:
+1
-1
@@ -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; }
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user