diff --git a/lib/markdown.awk b/lib/markdown.awk index 7fab0bb..3571904 100755 --- a/lib/markdown.awk +++ b/lib/markdown.awk @@ -45,6 +45,14 @@ function replaceInline(line, result, start, end) { # Build the result: before match, , content, , after match line = substr(line, 1, start-1) "" substr(line, start+1, RLENGTH-2) "" substr(line, end+1) } + # Replace occurrences of `...` with ... + while (match(line, /`([^`]+)`/)) { + + start = RSTART + end = RSTART + RLENGTH - 1 + # Build the result: before match, , content, , after match + line = substr(line, 1, start-1) "" substr(line, start+1, RLENGTH-2) "" substr(line, end+1) + } # Replace occurances of [link](url) with link while (match(line, /\[([^\]]+)\]\([^\)]+\)/)) {