Add horizontal bar to em dash conversion in tokenizer
This commit is contained in:
@@ -493,9 +493,11 @@ class Tokenizer(ABC):
|
|||||||
xRep = re.compile("|".join([re.escape(k) for k in repDict.keys()]), flags=re.DOTALL)
|
xRep = re.compile("|".join([re.escape(k) for k in repDict.keys()]), flags=re.DOTALL)
|
||||||
self._text = xRep.sub(lambda x: repDict[x.group(0)], self._text)
|
self._text = xRep.sub(lambda x: repDict[x.group(0)], self._text)
|
||||||
|
|
||||||
# Process the character translation map
|
# Process the translation map for placeholder characters
|
||||||
trDict = {nwUnicode.U_MAPOS: nwUnicode.U_RSQUO}
|
self._text = self._text.translate(str.maketrans({
|
||||||
self._text = self._text.translate(str.maketrans(trDict))
|
nwUnicode.U_MAPOS: nwUnicode.U_RSQUO,
|
||||||
|
nwUnicode.U_HBAR: nwUnicode.U_EMDASH,
|
||||||
|
}))
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ novelWriter – Text Pattern Functions
|
|||||||
====================================
|
====================================
|
||||||
|
|
||||||
File History:
|
File History:
|
||||||
Created: 2024-06-01 [2.5ec1]
|
Created: 2024-06-01 [2.5rc1] RegExPatterns
|
||||||
|
Created: 2024-11-04 [2.6b1] DialogParser
|
||||||
|
|
||||||
This file is a part of novelWriter
|
This file is a part of novelWriter
|
||||||
Copyright 2018–2024, Veronica Berglyd Olsen
|
Copyright 2018–2024, Veronica Berglyd Olsen
|
||||||
|
|||||||
Reference in New Issue
Block a user