summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-23 07:11:21 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-23 07:11:21 +0200
commit109fcc2deebb23025e17d981de1bd29669b33e9a (patch)
tree9a6f5b7a38ff7b28514a30f72f94223441402d73 /emitter.py
parent9673bc2b6008461b3e5bcb21cad925730e92baab (diff)
downloadruamel.yaml-109fcc2deebb23025e17d981de1bd29669b33e9a.tar.gz
fix #158 folded scalars not roundtripping0.15.61
Diffstat (limited to 'emitter.py')
-rw-r--r--emitter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/emitter.py b/emitter.py
index 0e447d3..5e5e29a 100644
--- a/emitter.py
+++ b/emitter.py
@@ -1365,7 +1365,7 @@ class Emitter(object):
if end < len(text):
ch = text[end]
if breaks:
- if ch is None or ch not in u'\n\x85\u2028\u2029':
+ if ch is None or ch not in u'\n\x85\u2028\u2029\a':
if (
not leading_space
and ch is not None
@@ -1394,12 +1394,16 @@ class Emitter(object):
self.stream.write(data)
start = end
else:
- if ch is None or ch in u' \n\x85\u2028\u2029':
+ if ch is None or ch in u' \n\x85\u2028\u2029\a':
data = text[start:end]
self.column += len(data)
if bool(self.encoding):
data = data.encode(self.encoding)
self.stream.write(data)
+ if ch == u'\a':
+ self.write_line_break()
+ self.write_indent()
+ end += 2 # \a and the space that is inserted on the fold
if ch is None:
self.write_line_break()
start = end