git.delta.rocks / jrsonnet / refs/commits / 1a20c75a0f1b

difftreelog

feat prettier yaml multi-line formatting

Yaroslav Bolyukin2024-01-16parent: #dbbcbc4.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-stdlib/src/manifest/yaml.rsdiffbeforeafterboth
134 buf.push_str(&options.padding);134 buf.push_str(&options.padding);
135 buf.push_str(line);135 buf.push_str(line);
136 }136 }
137 } else if !options.quote_keys && !yaml_needs_quotes(&s) {137 } else if s.contains('\n') {
138 buf.push_str("|-");
139 for line in s.split('\n') {
140 buf.push('\n');
141 buf.push_str(cur_padding);
142 buf.push_str(&options.padding);
143 buf.push_str(line);
144 }
145 } else if !options.quote_keys && !yaml_needs_quotes(&s) {
138 buf.push_str(&s);146 buf.push_str(&s);
139 } else {147 } else {
140 escape_string_json_buf(&s, buf);148 escape_string_json_buf(&s, buf);