diff --git a/src/post2html b/src/post2html
index b68ab7c..b332338 100755
--- a/src/post2html
+++ b/src/post2html
@@ -98,11 +98,11 @@ prefmt()
}
# ties
- { $0 = gensub( /([^\\])~/, "\\1 ", "g" ) }
- { $0 = gensub( /\\~/, "~", "g" ) }
+ !infence { $0 = gensub( /([^\\])~/, "\\1 ", "g" ) }
+ !infence { $0 = gensub( /\\~/, "~", "g" ) }
# TeX-style newline removal
- /%$/ {
+ !infence && /%$/ {
gsub( /%$/, "" )
printf "%s", $0
triml = 1
@@ -113,6 +113,7 @@ prefmt()
# code block is HTML and we want to render it as an example)
/^```/ {
gather = !gather
+ infence = gather
if ( gather ) gblock = ""
}
!/^```/ && gather { gblock = gblock $0 "\n" }