diff options
| author | Mitsuo Tokumori <[email protected]> | 2025-07-01 15:29:27 +0900 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2025-07-01 15:29:27 +0900 |
| commit | 9a878b2b6f94f955ca6caf9b44fb947635da67f1 (patch) | |
| tree | 580ab46823a76af307d5aac9ef48dd7766151b35 /public/.local/share/dmenu/snippet/htmlEscape.js | |
| parent | a2f2b28f086c455f85e3ec31c1fdde54b363744c (diff) | |
| download | dotfiles-9a878b2b6f94f955ca6caf9b44fb947635da67f1.tar.gz dotfiles-9a878b2b6f94f955ca6caf9b44fb947635da67f1.tar.bz2 dotfiles-9a878b2b6f94f955ca6caf9b44fb947635da67f1.zip | |
Add snippet.sh
Diffstat (limited to 'public/.local/share/dmenu/snippet/htmlEscape.js')
| -rw-r--r-- | public/.local/share/dmenu/snippet/htmlEscape.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/public/.local/share/dmenu/snippet/htmlEscape.js b/public/.local/share/dmenu/snippet/htmlEscape.js new file mode 100644 index 0000000..f4a3673 --- /dev/null +++ b/public/.local/share/dmenu/snippet/htmlEscape.js @@ -0,0 +1,9 @@ +/* https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html#7382028 */ +function htmlEscape(text) { + return String(text) + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """) + .replaceAll("'", "'"); +} |
