wesleyhales.com

Preformatting html code blocks

05 December 2006

util |

When the time comes to put html or xml settings as an example in your blog (or any html for that matter), this sed one-liner really helps out...

Replace the *** with an "&"... the page example won't render correctly if I use verbatim characters.

cat -v article.xhtml | sed -e "s/***lt;/\</g" -e "s/>/\***gt;/g" > article.code.xhtml