From 65a2052ffcb933b904b4bed154ec0ba2959a4eb4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 30 Jun 2019 23:43:37 -0500 Subject: "Naked" blocks must begin with "<" and end with ">" I had the "hey, here's a block here already!" detection set to only check for a tag at the end of the block, but realized that that could mess things up if a block ends on, say, an emphasized bit of text. This change checks both that the block begins with a tag and ends with a tag, which can still give false positives (and could engender some false negatives as well), but is, in my opinion, better overall. --- lht | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lht b/lht index 771fcad..247acf9 100755 --- a/lht +++ b/lht @@ -2,4 +2,4 @@ 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:"
"$0"
";print} +$0=(match($0,/^<.*>$/))?$0:""$0"
";print} -- cgit 1.4.1-21-gabe81