mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-09-10 11:40:24 +08:00
Fix for UnNew not working correctly with double quotes in chapter titles. May need to update-always existing epubs.
This commit is contained in:
@@ -265,20 +265,20 @@ def reset_orig_chapters_epub(inputio,outfile):
|
||||
chapterorigtitle = None
|
||||
tag = soup.find('meta',{'name':'chapterorigtitle'})
|
||||
if tag:
|
||||
chapterorigtitle = tag['content']
|
||||
chapterorigtitle = tag['content'].replace('"','"')
|
||||
|
||||
# toctitle is separate for add_chapter_numbers:toconly users.
|
||||
chaptertoctitle = None
|
||||
tag = soup.find('meta',{'name':'chaptertoctitle'})
|
||||
if tag:
|
||||
chaptertoctitle = tag['content']
|
||||
chaptertoctitle = tag['content'].replace('"','"')
|
||||
elif chapterorigtitle:
|
||||
chaptertoctitle = chapterorigtitle
|
||||
|
||||
chaptertitle = None
|
||||
tag = soup.find('meta',{'name':'chaptertitle'})
|
||||
if tag:
|
||||
chaptertitle = tag['content']
|
||||
chaptertitle = tag['content'].replace('"','"')
|
||||
|
||||
if chaptertitle and chapterorigtitle and chapterorigtitle != chaptertitle:
|
||||
origdata = data
|
||||
|
||||
@@ -658,11 +658,14 @@ div { margin: 0pt; padding: 0pt; }
|
||||
if chap.html:
|
||||
logger.debug('Writing chapter text for: %s' % chap.title)
|
||||
vals={'url':removeEntities(chap.url),
|
||||
'chapter':chap.title,
|
||||
'origchapter':chap.origtitle,
|
||||
'tocchapter':chap.toctitle,
|
||||
'chapter':removeEntities(chap.title),
|
||||
'origchapter':removeEntities(chap.origtitle),
|
||||
'tocchapter':removeEntities(chap.toctitle),
|
||||
'index':"%04d"%(index+1),
|
||||
'number':index+1}
|
||||
# escape double quotes in all vals.
|
||||
for k,v in vals.items():
|
||||
if isinstance(v,basestring): vals[k]=v.replace('"','"')
|
||||
fullhtml = CHAPTER_START.substitute(vals) + \
|
||||
chap.html + CHAPTER_END.substitute(vals)
|
||||
# ffnet(& maybe others) gives the whole chapter text
|
||||
|
||||
Reference in New Issue
Block a user