revert 'fix kyaml issue with multiline scalars'

This commit is contained in:
Natasha Sarkar
2021-07-15 14:24:39 -07:00
parent 0537b59f27
commit e17785af21
7 changed files with 19 additions and 75 deletions

View File

@@ -46,9 +46,6 @@ var unmarshalTests = []struct {
map[string]string{"v": "hi"},
}, {
"v: hi", map[string]interface{}{"v": "hi"},
}, {
"v: 'hi\nthis is a\nmultiline string\n'",
map[string]interface {}{"v":"hi\nthis is a\nmultiline string\n"},
}, {
"v: true",
map[string]string{"v": "true"},

View File

@@ -1699,8 +1699,8 @@ func yaml_emitter_write_single_quoted_scalar(emitter *yaml_emitter_t, value []by
if !put_break(emitter) {
return false
}
i++
} else if !write_break(emitter, value, &i) {
}
if !write_break(emitter, value, &i) {
return false
}
//emitter.indention = true

View File

@@ -2653,7 +2653,7 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si
// Do we need to fold line breaks?
if len(leading_break) > 0 && leading_break[0] == '\n' {
if len(trailing_breaks) == 0 {
s = append(s, '\n')
s = append(s, ' ')
} else {
s = append(s, trailing_breaks...)
}