about summary refs log tree commit diff stats
path: root/lht
blob: 5d46095a5affd22c76b50d0721c6a5227376180e (plain)
1
2
3
4
5
#!/usr/bin/awk -f
function s(t,i){while(match($0,t)){if(I[ni]==i)ni-=sub(t,"</"i">")
else if(sub(t,"<"i">"))I[++ni]=i}}BEGIN{FS="\n"; RS="";ni=0}
{$0=(match($0,/^<.*>$/))?$0:"<p>"$0"</p>"
s("__","strong");s("\\*","em");s("`","code"); print}