txt to html with hyperlink conversion

By Hal Canary, 2011-04-23 20:19:44 (link)
#computers-code;#uncategorized

I don't have time to be writing programs.

#!/bin/sed -f
1 i\
<!DOCTYPE HTML PUBLIC \
"-//W3C//DTD HTML 4.01 Transitional//EN" \
"http://www.w3.org/TR/html4/loose.dtd">\
<html><head>\
<meta http-equiv="Content-Type" \
content="text/html; charset=utf-8">\
<title></title></head><body>
s/\&/\&amp;/g;
s/\"/\&quot;/g;
s/</\&lt;/g;
s/>/\&gt;/g;
s/'/\&#0039;/g;
s/\(http:\/\/[^ ]\+\)/<a href="\1">\1<\/a>/g
1 s/^/<pre>/
$ s/$/<\/pre><\/body><\/html>/

(back)