summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-11 23:10:28 +0300
committerPaul Buetow <paul@buetow.org>2026-06-11 23:10:28 +0300
commit4c641b00e5f7910afcfd68af6fa149003ce07050 (patch)
tree6cc957415da04a12198ba3a2966aa92366f24397 /bin
parent7efb6b5e213a7c19b66da1592898c5627f139c17 (diff)
fm0 deduplicate escape wrappers
Diffstat (limited to 'bin')
-rwxr-xr-xbin/shuriken25
1 files changed, 8 insertions, 17 deletions
diff --git a/bin/shuriken b/bin/shuriken
index 376ee4b..6ce7a2f 100755
--- a/bin/shuriken
+++ b/bin/shuriken
@@ -486,15 +486,11 @@ resolve_sync_destinations() {
# Inlined from src/lib/template.source.sh
_html_escape() {
- local text="$1"; shift
-
- text=${text//&/\&amp;}
- text=${text//</\&lt;}
- text=${text//>/\&gt;}
- text=${text//\"/\&quot;}
- text=${text//\'/\&#39;}
+ local -r text="$1"; shift
+ local escaped_text
- printf '%s\n' "$text"
+ html_escape_to escaped_text "$text"
+ printf '%s\n' "$escaped_text"
}
html_escape_to() {
@@ -511,16 +507,11 @@ html_escape_to() {
}
_css_string_escape() {
- local text="$1"; shift
-
- text=${text//\\/\\\\}
- text=${text//&/\\000026}
- text=${text//</\\00003c}
- text=${text//>/\\00003e}
- text=${text//\"/\\000022}
- text=${text//\'/\\000027}
+ local -r text="$1"; shift
+ local escaped_text
- printf '%s\n' "$text"
+ css_string_escape_to escaped_text "$text"
+ printf '%s\n' "$escaped_text"
}
css_string_escape_to() {