File size: 354 Bytes
7e59e4c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/bin/bash
base_name=`basename $1 .html`
sed -e 's/<[Hh]0/<h1/g' \
-e 's/<\\[Hh]0/<\\h1/g' \
-e 's/<!--.*-->//g' \
-e 's?</*x>??g' \
$1 > $$.html
tidy -asxml -utf8 -o $$.xhtml $$.html
sed -e 's?<html.*>?<html xmlns=\"http://www.w3.org/1999/xhtml\" >?' \
-e 's/ / /g' \
$$.xhtml > ${base_name}.xhtml
rm $$.xhtml $$.html
|