Commit ed1690548e06ad52ce507d39b97082db9cd1cbd7

Thomas de Grivel 2023-02-14T13:53:53

escape html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/bin/ansi2html b/bin/ansi2html
index 9140cfb..d07678e 100755
--- a/bin/ansi2html
+++ b/bin/ansi2html
@@ -1,6 +1,9 @@
 #!/bin/sh
 for F; do
-    sed -e "s|$(printf '\33\\[0;34m')|<span style=\"color: blue;\">|g" \
+    sed -e 's|&|&amp;|g' \
+        -e 's|<|&lt;|g' \
+        -e 's|>|&gt;|g' \
+        -e "s|$(printf '\33\\[0;34m')|<span style=\"color: blue;\">|g" \
         -e "s|$(printf '\33\\[0;35m')|<span style=\"color: purple;\">|g" \
         -e "s|$(printf '\33\\[0m')|</span>|g" \
         -e 's|$|<br/>|' \