From 9a878b2b6f94f955ca6caf9b44fb947635da67f1 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Tue, 1 Jul 2025 15:29:27 +0900 Subject: Add snippet.sh --- public/.local/share/dmenu/snippet/htmlEscape.js | 9 +++++++++ public/.local/share/dmenu/snippet/test.sh | 1 + public/.local/share/dmenu/snippet/wikitable.wiki | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 public/.local/share/dmenu/snippet/htmlEscape.js create mode 100644 public/.local/share/dmenu/snippet/test.sh create mode 100644 public/.local/share/dmenu/snippet/wikitable.wiki (limited to 'public/.local/share/dmenu/snippet') 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("'", "'"); +} diff --git a/public/.local/share/dmenu/snippet/test.sh b/public/.local/share/dmenu/snippet/test.sh new file mode 100644 index 0000000..fcadfe3 --- /dev/null +++ b/public/.local/share/dmenu/snippet/test.sh @@ -0,0 +1 @@ +[ 0 -eq 1 ] && echo True || echo False diff --git a/public/.local/share/dmenu/snippet/wikitable.wiki b/public/.local/share/dmenu/snippet/wikitable.wiki new file mode 100644 index 0000000..4d05d14 --- /dev/null +++ b/public/.local/share/dmenu/snippet/wikitable.wiki @@ -0,0 +1,13 @@ +{| class="wikitable sortable" +|+ Meteorological seasons +|- +! Northern hemisphere !! Southern hemisphere !! Start date +|- +| Winter || Summer || 12月1日 +|- +| Spring || Autumn (aka: Fall) || 3月1日 +|- +| Summer || Winter || 6月1日 +|- +| Autumn (aka: Fall) || Spring || 9月1日 +|} -- cgit v1.2.3