Change order to allow inline on ends of p

This commit is contained in:
Case Duckworth 2019-07-01 12:37:58 -05:00
parent d29f07145a
commit 8e591b1b11

4
lht
View File

@ -1,5 +1,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}
{s("[\\*_]{2}","strong");s("[\\*_]","em");s("`","code")
$0=(match($0,/^<.*>$/))?$0:"<p>"$0"</p>";print}
{$0=(match($0,/^<.*>$/))?$0:"<p>"$0"</p>"
s("__","strong");s("\\*","em");s("`","code"); print}