Browse code

improved replacement filters for textile markup on github backtick codeblocks, added comment to show regular HTML support

Brandon Mathis authored on 28/07/2011 at 19:21:34
Showing 1 changed files
... ...
@@ -36,10 +36,11 @@ module OctopressFilters
36 36
     # Textile support
37 37
     input = input.gsub /<p>`{3}\s(\w+)<br\s*\/>\n(.+?)`{3}<\/p>/m do
38 38
       lang = $1
39
-      str  = $2.gsub(/^\s{4}/, '').gsub(/<br\s*\/>$/, '')
39
+      str  = $2.gsub('&lt;','<').gsub('&gt;','>').gsub(/^\s{4}/, '').gsub(/(<br\s\/>)?$/, '')
40 40
       highlight(str, lang)
41 41
     end
42 42
 
43
+    # Regular HTML support
43 44
     input.gsub /^`{3}\s(\w+)\n(.+?)\n`{3}/m do
44 45
       lang = $1
45 46
       str  = $2.gsub(/^\s{4}/, '')