lua-yaml: improve multiline string output
Added tarantool.compat option that allows yaml.encode() to encodes all strings containing a newline in a more convenient block scalar style. This is a breaking change, programs that rely on precise lyaml encoding may fail if the new behavior is selected. Closes #3012 Requires #7060 Requires #8007 @TarantoolBot document Title: YAML formatter improvement Now yaml.encode() can encode strings with a newline in block scalar style, see https://yaml.org/spec/1.2-old/spec.html#style/block/literal and https://github.com/tarantool/tarantool/wiki/compat%3Ayaml_pretty_multiline old: ``` tarantool> compat.yaml_pretty_multiline = 'old' --- ... tarantool> return "Title: xxx\n- Item 1\n- Item 2\n" --- - 'Title: xxx - Item 1 - Item 2 ' ... ``` new: ``` tarantool> compat.yaml_pretty_multiline = 'new' --- ... tarantool> return "Title: xxx\n- Item 1\n- Item 2\n" --- - | Title: xxx - Item 1 - Item 2 ... ```
Showing
- changelogs/unreleased/gh-3012-yaml-prettier-multiline-output 4 additions, 0 deletionschangelogs/unreleased/gh-3012-yaml-prettier-multiline-output
- src/lua/compat.c 19 additions, 0 deletionssrc/lua/compat.c
- src/lua/compat.lua 15 additions, 0 deletionssrc/lua/compat.lua
- test/app-luatest/gh_3012_yaml_prettier_multiline_output_test.lua 17 additions, 0 deletions...p-luatest/gh_3012_yaml_prettier_multiline_output_test.lua
- third_party/lua-yaml/lyaml.cc 4 additions, 3 deletionsthird_party/lua-yaml/lyaml.cc
- third_party/lua-yaml/lyaml.h 3 additions, 0 deletionsthird_party/lua-yaml/lyaml.h
Loading
Please register or sign in to comment