X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=html-sh.sed;h=16aeb9a44e907814b5865fb9887fbe9833f450d8;hp=514caafccaf81863f5254602f1a495363638e4f0;hb=84e1d6938743a21a912420cc4ba5dc08a7c48155;hpb=cbd426df72dee35e5920de18084ca6770454481d
diff --git a/html-sh.sed b/html-sh.sed
index 514caaf..16aeb9a 100755
--- a/html-sh.sed
+++ b/html-sh.sed
@@ -1,4 +1,12 @@
-#!/bin/sed -nrf
+#!/bin/sed -nEf
+
+:Escapes
+s,\\\\,\\,g; s,\\&,\&,g;
+s,\\<,\<,g; s,\\>,\>,g;
+s,\\",\",g; s,\\',\',g;
+s,\\\[,\[,g; s,\\\],\],g;
+s,\\\.,\.,g; s,\\#,\#,g;
+s,\\,,g;
:CommentHandle
x; /^<\/!-->/{
@@ -40,6 +48,7 @@ t tagopen;
G; h; s;^[^\n]*\n+;;; x; s;\n.*$;;;
:attribs
+s;(<[^/][^>]*)>[ \t]*\.[ \t];\1>;g; t attEnd;
s;class="([^>]+)>[ \t]*\.([^< \t]+);class="\2 \1>;g; t attribs;
s;(<[^/][^>]*)>[ \t]*\.([^< \t]+);\1 class="\2">;g;
s;(<[^/][^>]*)>[ \t]*#([^< \t]+);\1 id="\2">;g;
@@ -50,9 +59,11 @@ s;(]+ )?type=(checkbox|"checkbox"|'checkbox')( [^>]+)?)>[ \t]*(checke
s;(