From 1a20c75a0f1bc401789090a93fc0404fa2ad0e7b Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 16 Jan 2024 08:43:19 +0000 Subject: [PATCH] feat: prettier yaml multi-line formatting --- --- a/crates/jrsonnet-stdlib/src/manifest/yaml.rs +++ b/crates/jrsonnet-stdlib/src/manifest/yaml.rs @@ -134,6 +134,14 @@ buf.push_str(&options.padding); buf.push_str(line); } + } else if s.contains('\n') { + buf.push_str("|-"); + for line in s.split('\n') { + buf.push('\n'); + buf.push_str(cur_padding); + buf.push_str(&options.padding); + buf.push_str(line); + } } else if !options.quote_keys && !yaml_needs_quotes(&s) { buf.push_str(&s); } else { -- gitstuff