Update tokenizer and html converter
This commit is contained in:
@@ -28,9 +28,13 @@ class ToHtml(Tokenizer):
|
||||
Tokenizer.doAutoReplace(self)
|
||||
|
||||
repDict = {
|
||||
"<" : "<",
|
||||
">" : ">",
|
||||
"&" : "&",
|
||||
"<" : "<",
|
||||
">" : ">",
|
||||
"&" : "&",
|
||||
"\u2013" : "&endash;",
|
||||
"\u2014" : "$emdash;",
|
||||
"\u2500" : "$emdash;",
|
||||
"\u2026" : "…",
|
||||
}
|
||||
xRep = re.compile("|".join([re.escape(k) for k in repDict.keys()]), flags=re.DOTALL)
|
||||
self.theText = xRep.sub(lambda x: repDict[x.group(0)], self.theText)
|
||||
|
||||
Reference in New Issue
Block a user