Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.

Commit 39d9693

Browse files
committed
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.
1 parent 01543d9 commit 39d9693

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

plugins/octopress_filters.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,17 @@ def backtick_codeblock(input)
3030
input = input.gsub /<p>`{3}\s*(\w+)?<\/p>\s*<pre><code>\s*(.+?)\s*<\/code><\/pre>\s*<p>`{3}<\/p>/m do
3131
lang = $1
3232
if lang != ''
33-
str = $2.gsub('&lt;','<').gsub('&gt;','>')
33+
str = $2.gsub('&lt;','<').gsub('&gt;','>').gsub('&amp;','&')
3434
highlight(str, lang)
3535
else
3636
"<pre><code>#{$2}</code></pre>"
3737
end
3838
end
3939

40-
# Textile support
40+
# Textile warning
4141
input = input.gsub /<p>`{3}\s*(\w+)?<br\s*\/>\n(.+?)`{3}<\/p>/m do
4242
lang = $1
43-
str = $2.gsub('&lt;','<').gsub('&gt;','>').gsub(/^\s{4}/, '').gsub(/(<br\s\/>)?$/, '')
44-
if lang != ''
45-
highlight(str, lang)
46-
else
47-
"<pre><code>#{$2}</code></pre>"
48-
end
43+
"<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>"
4944
end
5045

5146
# Regular HTML support

0 commit comments

Comments
 (0)