mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
Strip html tags and entities from epub chapter titles.
This commit is contained in:
parent
7f0c989319
commit
215552af00
2 changed files with 5 additions and 3 deletions
2
app.yaml
2
app.yaml
|
|
@ -1,4 +1,4 @@
|
|||
# fanfictionloader
|
||||
# fanfictionloader ffd-retief
|
||||
application: fanfictionloader
|
||||
version: 4-0-0
|
||||
runtime: python
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from zipfile import ZipFile, ZIP_STORED, ZIP_DEFLATED
|
|||
from xml.dom.minidom import parse, parseString, getDOMImplementation
|
||||
|
||||
from base_writer import *
|
||||
from fanficdownloader.htmlcleanup import stripHTML
|
||||
|
||||
class EpubWriter(BaseStoryWriter):
|
||||
|
||||
|
|
@ -153,7 +154,7 @@ h6 { text-align: center; }
|
|||
''')
|
||||
|
||||
def getMetadata(self,key):
|
||||
return removeAllEntities(self.story.getMetadata(key))
|
||||
return stripHTML(self.story.getMetadata(key))
|
||||
|
||||
def writeStoryImpl(self, out):
|
||||
|
||||
|
|
@ -361,7 +362,8 @@ h6 { text-align: center; }
|
|||
tocnavMap.appendChild(navPoint)
|
||||
navLabel = newTag(tocncxdom,"navLabel")
|
||||
navPoint.appendChild(navLabel)
|
||||
navLabel.appendChild(newTag(tocncxdom,"text",text=title))
|
||||
## the xml library will re-escape as needed.
|
||||
navLabel.appendChild(newTag(tocncxdom,"text",text=stripHTML(title)))
|
||||
navPoint.appendChild(newTag(tocncxdom,"content",attrs={"src":href}))
|
||||
index=index+1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue