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

This commit is contained in:
Brandon Mathis 2011-07-28 15:21:34 -04:00
parent 7209aaf64c
commit a516c773d1

View File

@ -36,10 +36,11 @@ module OctopressFilters
# Textile support # Textile support
input = input.gsub /<p>`{3}\s(\w+)<br\s*\/>\n(.+?)`{3}<\/p>/m do input = input.gsub /<p>`{3}\s(\w+)<br\s*\/>\n(.+?)`{3}<\/p>/m do
lang = $1 lang = $1
str = $2.gsub(/^\s{4}/, '').gsub(/<br\s*\/>$/, '') str = $2.gsub('&lt;','<').gsub('&gt;','>').gsub(/^\s{4}/, '').gsub(/(<br\s\/>)?$/, '')
highlight(str, lang) highlight(str, lang)
end end
# Regular HTML support
input.gsub /^`{3}\s(\w+)\n(.+?)\n`{3}/m do input.gsub /^`{3}\s(\w+)\n(.+?)\n`{3}/m do
lang = $1 lang = $1
str = $2.gsub(/^\s{4}/, '') str = $2.gsub(/^\s{4}/, '')