X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=html-sh.sed;h=16aeb9a44e907814b5865fb9887fbe9833f450d8;hp=cb1c613185356b03eac15be9fd59967f3b769784;hb=84e1d6938743a21a912420cc4ba5dc08a7c48155;hpb=e63a06bdd89bd5c3cb7232f3a5b6bf4a1f51493b diff --git a/html-sh.sed b/html-sh.sed index cb1c613..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,6 +59,7 @@ s;(]+ )?type=(checkbox|"checkbox"|'checkbox')( [^>]+)?)>[ \t]*(checke s;(]+)?)>[ \t]*(checked|selected);\1 selected="selected">;g; s;(]+)?)>[ \t]*multiple;\1 multiple="multiple">;g; t attribs; +:attEnd s;(<[^/][^>]*>)[ \t]*;\1;g; # s;(<[^/][^>]*)>[ \t]*]+>;\1/>;g;