Skip to content

Commit

Permalink
wrap strings in quotes when printing yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
immortalsoftware committed Sep 6, 2018
1 parent cd8370d commit 0619a84
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ public void output(Node node, String name, int level, StringBuilder builder) {

level++;
for (PropertyMetaModel a : attributes) {
String text = "\"" + a.getValue(node).toString().replace("\\", "\\\\").
replaceAll("\"", "\\\\\"").replace("\n", "\\n").replace("\t", "\\t")
+ "\"";
builder.append(System.lineSeparator() + indent(level) + a.getName() + ": \""
+ a.getValue(node).toString() + "\"");
+ text + "\"");
}

for (PropertyMetaModel sn : subNodes) {
Expand Down

0 comments on commit 0619a84

Please sign in to comment.