Properly export tabs to text and html
This commit is contained in:
@@ -41,9 +41,10 @@ class ToHtml(Tokenizer):
|
||||
Tokenizer.doAutoReplace(self)
|
||||
|
||||
repDict = {
|
||||
"<" : "<",
|
||||
">" : ">",
|
||||
"&" : "&",
|
||||
"<" : "<",
|
||||
">" : ">",
|
||||
"&" : "&",
|
||||
"\t" : " ",
|
||||
nwUnicode.U_ENDASH : nwUnicode.H_ENDASH,
|
||||
nwUnicode.U_EMDASH : nwUnicode.H_EMDASH,
|
||||
nwUnicode.U_HELLIP : nwUnicode.H_HELLIP,
|
||||
|
||||
@@ -30,6 +30,7 @@ class ToText(Tokenizer):
|
||||
Tokenizer.doAutoReplace(self)
|
||||
|
||||
repDict = {
|
||||
"\t" : " ",
|
||||
nwUnicode.U_NBSP : " ",
|
||||
}
|
||||
xRep = re.compile("|".join([re.escape(k) for k in repDict.keys()]), flags=re.DOTALL)
|
||||
@@ -92,7 +93,7 @@ class ToText(Tokenizer):
|
||||
# indicating a new paragraph.
|
||||
if tType == self.T_EMPTY:
|
||||
if len(thisPar) > 0:
|
||||
tTemp = " ".join(thisPar)
|
||||
tTemp = "\n".join(thisPar)
|
||||
self.theResult += "%s\n\n" % tTemp.rstrip()
|
||||
thisPar = []
|
||||
|
||||
|
||||
@@ -62,14 +62,14 @@ class Tokenizer():
|
||||
self.theTokens = None
|
||||
self.theResult = None
|
||||
|
||||
self.wordWrap = 80
|
||||
self.wordWrap = 0
|
||||
self.doComments = False
|
||||
self.doKeywords = False
|
||||
|
||||
self.fmtTitle = "%title%"
|
||||
self.fmtChapter = "Chapter %numword%: %title%"
|
||||
self.fmtChapter = "%title%"
|
||||
self.fmtUnNum = "%title%"
|
||||
self.fmtScene = "* * *"
|
||||
self.fmtScene = "%title%"
|
||||
self.fmtSection = "%title%"
|
||||
|
||||
self.hideScene = False
|
||||
@@ -224,7 +224,7 @@ class Tokenizer():
|
||||
isScene = self.theItem.itemLayout == nwItemLayout.SCENE
|
||||
isNote = self.theItem.itemLayout == nwItemLayout.NOTE
|
||||
|
||||
# No special header formatting for notes and no layout files
|
||||
# No special header formatting for notes and no-layout files
|
||||
if isNone: return
|
||||
if isNote: return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user