diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb index f2a5073..67118b5 100644 --- a/plugins/octopress_filters.rb +++ b/plugins/octopress_filters.rb @@ -30,22 +30,17 @@ module OctopressFilters input = input.gsub /
`{3}\s*(\w+)?<\/p>\s*
\s*(.+?)\s*<\/code><\/pre>\s*`{3}<\/p>/m do
lang = $1
if lang != ''
- str = $2.gsub('<','<').gsub('>','>')
+ str = $2.gsub('<','<').gsub('>','>').gsub('&','&')
highlight(str, lang)
else
"
#{$2}
"
end
end
- # Textile support
+ # Textile warning
input = input.gsub /`{3}\s*(\w+)?
\n(.+?)`{3}<\/p>/m do
lang = $1
- str = $2.gsub('<','<').gsub('>','>').gsub(/^\s{4}/, '').gsub(/(
)?$/, '')
- if lang != ''
- highlight(str, lang)
- else
- "
#{$2}
"
- end
+ "Back tick code blocks are not supported for Textile.\nTry HTML or Markdown instead or use the codeblock tag.\n\n{% codeblock #{lang} %}\nYour code snippet\n{% endcodeblock %}
"
end
# Regular HTML support