Browse Source

Backtick codeblocks now correctly replace & with & and Textile support for back tick code blocks has been removed. It never really worked. Textile makes me sad.

unreleased_contents
Brandon Mathis 13 years ago
parent
commit
ff1dba19f2
  1. 11
      plugins/octopress_filters.rb

11
plugins/octopress_filters.rb

@ -30,22 +30,17 @@ module OctopressFilters
input = input.gsub /<p>`{3}\s*(\w+)?<\/p>\s*<pre><code>\s*(.+?)\s*<\/code><\/pre>\s*<p>`{3}<\/p>/m do
lang = $1
if lang != ''
str = $2.gsub('&lt;','<').gsub('&gt;','>')
str = $2.gsub('&lt;','<').gsub('&gt;','>').gsub('&amp;','&')
highlight(str, lang)
else
"<pre><code>#{$2}</code></pre>"
end
end
# Textile support
# Textile warning
input = input.gsub /<p>`{3}\s*(\w+)?<br\s*\/>\n(.+?)`{3}<\/p>/m do
lang = $1
str = $2.gsub('&lt;','<').gsub('&gt;','>').gsub(/^\s{4}/, '').gsub(/(<br\s\/>)?$/, '')
if lang != ''
highlight(str, lang)
else
"<pre><code>#{$2}</code></pre>"
end
"<pre><code>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 %}</code></pre>"
end
# Regular HTML support

Loading…
Cancel
Save