Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
In EscapeJinjavaFilter, escape both double closing braces to not have…
… a mismatch
  • Loading branch information
jasmith-hs committed Mar 10, 2023
commit 29a7c0996904f60f9c032e3ac888eb3e4c265b97
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static String escapeJinjavaEntities(String input) {
public static String escapeFullJinjavaEntities(String input) {
return input
.replace("{{", BLBRACE + BLBRACE)
.replace("}}", BRBRACE + BRBRACE)
.replaceAll("\\{([{%#])", BLBRACE + "$1")
.replaceAll("([}%#])}", "$1" + BRBRACE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testDoesNotEscapeJson() {
f.filter("{'foo': 'bar', '{{{ foo }}}': '{% bar %}'}", interpreter, "false")
)
.isEqualTo(
"{'foo': 'bar', '{{{ foo }}}': '{% bar %}'}"
"{'foo': 'bar', '{{{ foo }}}': '{% bar %}'}"
);
}
}