Skip to content

Commit

Permalink
Adjusting regex captures and adjusting logic for skipping escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
id-keenan committed May 14, 2021
1 parent 2264a1b commit 51c86f6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class ContentVariableReplacementUtil {

private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\{\\{([a-zA-Z0-9_:\\-]+\\.[a-zA-Z0-9_:\\-]+(\\|?[a-zA-Z0-9_:\\-]*))}}");
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\{\\{([a-zA-Z0-9_:\\-]+\\.[a-zA-Z0-9_:\\-]+(\\|[a-zA-Z0-9_:\\-]*)?)}}");
private static final Map<String, String> REQUIRED_ESCAPE = escapeMap();
private static final String PLACEHOLDER_BEGIN = "{{";
private static final String PLACEHOLDER_END = "}}";
Expand Down Expand Up @@ -117,7 +117,7 @@ public static List<String> getKeys(String string) {
*/
public static String doReplacement(String input, String key, String replacement, TransformAction action) {
if (action != null) {
if (!action.disableEscaping()) {
if (action.disableEscaping()) {
return input.replace(getPlaceholder(key), action.execute(replacement));
}
return input.replace(getPlaceholder(key), baseEscaping(action.execute(replacement)));
Expand Down

0 comments on commit 51c86f6

Please sign in to comment.