]> git.plutz.net Git - cgilite/commitdiff
escaping features
authorPaul Hänsch <paul@plutz.net>
Tue, 26 Feb 2019 21:48:31 +0000 (22:48 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 26 Feb 2019 21:48:31 +0000 (22:48 +0100)
html-sh.sed

index 514caafccaf81863f5254602f1a495363638e4f0..3f63b3d6fecf14dfd8808a3d58f655ff173e3040 100755 (executable)
@@ -1,4 +1,12 @@
-#!/bin/sed -nrf
+#!/bin/sed -nEf
+
+:Escapes
+s,\\\\,\&#92;,g; s,\\&,\&amp;,g;
+s,\\<,\&lt;,g; s,\\>,\&gt;,g;
+s,\\",\&quot;,g; s,\\',\&apos;,g;
+s,\\\[,\&#91;,g; s,\\\],\&#93;,g;
+s,\\\.,\&#46;,g; s,\\#,\&#35;,g;
+s,\\,,g;
 
 :CommentHandle
 x; /^<\/!-->/{