1
0
mirror of synced 2026-08-31 06:25:09 +00:00

Polish HtmlTemplates

This commit changes HtmlTemplates to use replace
instead of replaceAll since supporting regex in template
keys is not needed.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
This commit is contained in:
Josh Cummings
2026-04-15 14:59:21 -06:00
parent 44d32815b1
commit 3cf9397a7d
3 changed files with 6 additions and 6 deletions
@@ -86,8 +86,8 @@ final class HtmlTemplates {
String render() {
String template = this.template;
for (String key : this.values.keySet()) {
String pattern = Pattern.quote("{{" + key + "}}");
template = template.replaceAll(pattern, this.values.get(key));
String pattern = "{{" + key + "}}";
template = template.replace(pattern, this.values.get(key));
}
String unusedPlaceholders = Pattern.compile("\\{\\{([a-zA-Z0-9]+)}}")
@@ -87,8 +87,8 @@ final class HtmlTemplates {
String render() {
String template = this.template;
for (String key : this.values.keySet()) {
String pattern = Pattern.quote("{{" + key + "}}");
template = template.replaceAll(pattern, this.values.get(key));
String pattern = "{{" + key + "}}";
template = template.replace(pattern, this.values.get(key));
}
String unusedPlaceholders = Pattern.compile("\\{\\{([a-zA-Z0-9]+)}}")
@@ -89,8 +89,8 @@ final class HtmlTemplates {
String render() {
String template = this.template;
for (String key : this.values.keySet()) {
String pattern = Pattern.quote("{{" + key + "}}");
template = template.replaceAll(pattern, this.values.get(key));
String pattern = "{{" + key + "}}";
template = template.replace(pattern, this.values.get(key));
}
String unusedPlaceholders = Pattern.compile("\\{\\{([a-zA-Z0-9]+)}}")