Skip to content
Snippets Groups Projects
Commit 8b58052e authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

YAML: use LITERAL style for multi-line strings

parent 6f69fb5f
No related branches found
No related tags found
No related merge requests found
...@@ -665,6 +665,9 @@ dump_node(struct lua_yaml_dumper *dumper) ...@@ -665,6 +665,9 @@ dump_node(struct lua_yaml_dumper *dumper)
} else if (lua_isnumber(dumper->L, -1)) { } else if (lua_isnumber(dumper->L, -1)) {
/* string is convertible to number, quote it to preserve type */ /* string is convertible to number, quote it to preserve type */
style = YAML_SINGLE_QUOTED_SCALAR_STYLE; style = YAML_SINGLE_QUOTED_SCALAR_STYLE;
} else if (strchr(str, '\n') != NULL) {
/* use LITERAL style for multiline strings */
style = YAML_LITERAL_SCALAR_STYLE;
} }
strbreak: strbreak:
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment