diff options
1 files changed, 5 insertions, 2 deletions
| -rw-r--r-- | single.awk | 7 |
@@ -13,8 +13,8 @@ # [ ] Links # [ ] Inline # [ ] Reference -# [ ] Code # [x] Emphasis +# [x] Code # [ ] Images # [ ] Inline # [ ] Reference @@ -156,8 +156,9 @@ function sub_match(replacement) { } function surround(brace, left, right, blen) { if (blen == "") { blen = length(brace) } - if (match($0, brace "[^" brace "]+" brace)) { + if (match($0, brace (brace == "``" ? "." : "[^" brace "]") "+" brace)) { elem = left substr($0, RSTART + blen, RLENGTH - 2*blen) right + if (brace == "``") { gsub("`", "\\`", elem) } sub_match(elem) return 1; } @@ -185,6 +186,8 @@ function gsurround(brace, left, right, blen) { gsurround("_" , "<em>" , "</em>") gsurround("\\*\\*", "<strong>", "</strong>", 2) gsurround("\\*" , "<em>" , "</em>", 1) + gsurround("``" , "<code>" , "</code>") + gsurround("`" , "<code>" , "</code>") } # Paragraph |
