diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-06-16 09:38:32 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-06-16 09:38:32 +0200 |
commit | 5e1d9fc21cf360295074f12455095f1e403e82af (patch) | |
tree | 117a6dd23f817f95cdfa8288ae57d77908ed10b8 /emitter.py | |
parent | b3205ef9fce5074754c201a76740802e88bb5dd6 (diff) | |
download | ruamel.yaml-5e1d9fc21cf360295074f12455095f1e403e82af.tar.gz |
fix issue #127: quotes for tagged scalars0.15.9
also fixes spurious newlines when using tagged scalars in block sequences
Diffstat (limited to 'emitter.py')
-rw-r--r-- | emitter.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -629,6 +629,9 @@ class Emitter(object): self.prepared_tag = self.prepare_tag(tag) if self.prepared_tag: self.write_indicator(self.prepared_tag, True) + if self.sequence_context and not self.flow_level and \ + isinstance(self.event, ScalarEvent): + self.no_newline = True self.prepared_tag = None def choose_scalar_style(self): @@ -638,7 +641,7 @@ class Emitter(object): if self.event.style == '"' or self.canonical: return '"' if (not self.event.style or self.event.style == '?') and \ - self.event.implicit[0]: + (self.event.implicit[0] or not self.event.implicit[2]): if (not (self.simple_key_context and (self.analysis.empty or self.analysis.multiline)) and (self.flow_level and self.analysis.allow_flow_plain or |