make "checked" and "selected" keywords interchangeable
authorPaul Hänsch <paul@plutz.net>
Tue, 17 Jul 2018 00:06:10 +0000 (02:06 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 17 Jul 2018 00:06:10 +0000 (02:06 +0200)
html-sh.sed

index d1c70b8..514caaf 100755 (executable)
@@ -45,8 +45,8 @@ s;(<[^/][^>]*)>[ \t]*\.([^< \t]+);\1 class="\2">;g;
 s;(<[^/][^>]*)>[ \t]*#([^< \t]+);\1 id="\2">;g;
 s;(<[^/][^>]*)>[ \t]*([^ \t=<]+=("[^"]*"|'[^']*'|[^< \t]*));\1 \2>;g;
 t attribs;
-s;(<input ([^>]+ )?type=(radio|"radio"|'radio')( [^>]+)?)>[ \t]*checked;\1 checked="checked">;g;
-s;(<input ([^>]+ )?type=(checkbox|"checkbox"|'checkbox')( [^>]+)?)>[ \t]*checked;\1 checked="checked">;g;
+s;(<input ([^>]+ )?type=(radio|"radio"|'radio')( [^>]+)?)>[ \t]*(checked|selected);\1 checked="checked">;g;
+s;(<input ([^>]+ )?type=(checkbox|"checkbox"|'checkbox')( [^>]+)?)>[ \t]*(checked|selected);\1 checked="checked">;g;
 s;(<option( [^>]+)?)>[ \t]*(checked|selected);\1 selected="selected">;g;
 s;(<select( [^>]+)?)>[ \t]*multiple;\1 multiple="multiple">;g;
 t attribs;