mirror of
https://github.com/moparisthebest/www.moparscape.org
synced 2024-12-25 17:08:49 -05:00
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.
This commit is contained in:
parent
5d24e0ba2b
commit
ff1dba19f2
@ -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('<','<').gsub('>','>')
|
||||
str = $2.gsub('<','<').gsub('>','>').gsub('&','&')
|
||||
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('<','<').gsub('>','>').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…
Reference in New Issue
Block a user