+# code blocks
+/^ *```/ {
+ x
+ # check if hold space contains READING
+ # this is to see if this is the first ``` we read or no
+ /^ *READING/ !{
+ # if it is the first one, add READING to hold space
+ s/.*/READING/
+ x
+ # write opening tag (also concat with next line)
+ N
+ s/.*\n(.*)/<pre><code>\1/
+ b
+ }
+ # if its the second ```, we are done
+ # first clear hold
+ s/.*//
+ x
+ # then write closing tag
+ s/.*/<\/code><\/pre>/
+ b
+}
+
+# if we aren't reading ```, but hold space has READING in it
+# that means we are currently processing a block, just ignore and
+# keep going
+x
+/^ *READING/ {
+ x
+ b
+}
+x
+
+
+# horizontal rule
+s/^\s*-{3,}\s*$/<hr\/>/
+