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 514caaf..3f63b3d 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; /^<\/!-->/{