summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2020-03-15 10:49:21 +0100
committerLars-Dominik Braun <lars@6xq.net>2020-03-15 10:49:21 +0100
commit7d1cea9ca5cfbe4a995b5c638cf1cc61c3d9432f (patch)
tree07fd3f991220ac3cd86daa52b727544441532977
parent6905213d27001df957b6411e59ddc949c029c3df (diff)
downloadlulua-7d1cea9ca5cfbe4a995b5c638cf1cc61c3d9432f.tar.gz
lulua-7d1cea9ca5cfbe4a995b5c638cf1cc61c3d9432f.tar.bz2
lulua-7d1cea9ca5cfbe4a995b5c638cf1cc61c3d9432f.zip
text: Fix newlines
Replace Windows-style newlines with Unix newlines. There were quite a few stray \r’s in the stats. This takes care of them.
-rw-r--r--lulua/text.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lulua/text.py b/lulua/text.py
index 1d46af8..f988c2a 100644
--- a/lulua/text.py
+++ b/lulua/text.py
@@ -261,8 +261,9 @@ def writeWorker (layout, sourceFunc, inq, outq):
# extract (can be multiple items per source)
for text in sourceFunc (item):
- # map chars
- text = mapChars (text, charMap)
+ # map chars; make sure we’re using unix line endings, which is
+ # only one character
+ text = mapChars (text, charMap).replace ('\r\n', '\n')
# init a new writer for every item
w = Writer (layout)