... | ... |
@@ -26,7 +26,7 @@ module OctopressFilters |
26 | 26 |
# code snippet |
27 | 27 |
# ``` |
28 | 28 |
def backtick_codeblock(input) |
29 |
- input.gsub /<p>`{3}\s(\w+)<\/p>.+<pre><code>(.+)<\/code><\/pre>.+`{3}<\/p>/m do |
|
29 |
+ input.gsub /<p>`{3}\s(\w+)<\/p>\n\n<pre><code>([^<]+)<\/code><\/pre>\n\n<p>`{3}<\/p>/m do |
|
30 | 30 |
lang = $1 |
31 | 31 |
str = $2.gsub('<','<').gsub('>','>') |
32 | 32 |
highlight(str, lang) |