| ... | ... |
@@ -30,22 +30,17 @@ module OctopressFilters |
| 30 | 30 |
input = input.gsub /<p>`{3}\s*(\w+)?<\/p>\s*<pre><code>\s*(.+?)\s*<\/code><\/pre>\s*<p>`{3}<\/p>/m do
|
| 31 | 31 |
lang = $1 |
| 32 | 32 |
if lang != '' |
| 33 |
- str = $2.gsub('<','<').gsub('>','>')
|
|
| 33 |
+ str = $2.gsub('<','<').gsub('>','>').gsub('&','&')
|
|
| 34 | 34 |
highlight(str, lang) |
| 35 | 35 |
else |
| 36 | 36 |
"<pre><code>#{$2}</code></pre>"
|
| 37 | 37 |
end |
| 38 | 38 |
end |
| 39 | 39 |
|
| 40 |
- # Textile support |
|
| 40 |
+ # Textile warning |
|
| 41 | 41 |
input = input.gsub /<p>`{3}\s*(\w+)?<br\s*\/>\n(.+?)`{3}<\/p>/m do
|
| 42 | 42 |
lang = $1 |
| 43 |
- str = $2.gsub('<','<').gsub('>','>').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>"
|
|
| 49 | 44 |
end |
| 50 | 45 |
|
| 51 | 46 |
# Regular HTML support |