diff --git a/src/post2html b/src/post2html index 8fd821f..eeafa77 100755 --- a/src/post2html +++ b/src/post2html @@ -109,6 +109,15 @@ prefmt() next } + # reference to the content of the last fence (e.g. if a previous + # code block is HTML and we want to render it as an example) + /^```/ { + gather = !gather + if ( gather ) gblock = "" + } + !/^```/ && gather { gblock = gblock $0 "\n" } + !gather && /^ *@LASTFENCE@$/ { print gblock; next } + { print } ' }