Skip to content
Snippets Groups Projects
Commit b78beaf5 authored by René Schöne's avatar René Schöne
Browse files

apply suggested fix for #3

parent 74654ffb
No related branches found
No related tags found
No related merge requests found
......@@ -56,8 +56,14 @@ aspect Helpers {
// --- helper methods for put/add ---
protected SimpleElement ComplexElement.makeStringElement(String value) {
if (value == null || value.equals("null")) {
return StringElement.of("null");
}
if (value.isBlank()) {
return StringElement.of(value);
}
// simple test, check for special characters
return containsAny(value, "[{\"\n") ?
return containsAny(value, ":#,[{\"\n") ?
StringElement.of(value.replace("\n", "\\n").replace("\"", "\\\"")) :
ValueElement.of(value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment