aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-08-01 09:06:37 -0400
committerBrandon Mathis <brandon@imathis.com>2011-08-01 09:06:55 -0400
commitff1dba19f2f08e31a928778bdd94663b98d7dc19 (patch)
treed3e700f4d0056ed8984fe78df84539b097dca99f
parent5d24e0ba2b3ae72f56b3e9daf586b8e7bccfd6ae (diff)
downloadmy_new_personal_website-ff1dba19f2f08e31a928778bdd94663b98d7dc19.tar.xz
my_new_personal_website-ff1dba19f2f08e31a928778bdd94663b98d7dc19.zip
Backtick codeblocks now correctly replace &amp; with & and Textile support for back tick code blocks has been removed. It never really worked. Textile makes me sad.
Diffstat (limited to '')
-rw-r--r--plugins/octopress_filters.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb
index f2a5073b..67118b53 100644
--- a/plugins/octopress_filters.rb
+++ b/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