mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-01 07:45:01 -04:00
improved replacement filters for textile markup on github backtick codeblocks, added comment to show regular HTML support
This commit is contained in:
parent
d10d222076
commit
f2d3fb5aec
@ -36,10 +36,11 @@ module OctopressFilters
|
||||
# Textile support
|
||||
input = input.gsub /<p>`{3}\s(\w+)<br\s*\/>\n(.+?)`{3}<\/p>/m do
|
||||
lang = $1
|
||||
str = $2.gsub(/^\s{4}/, '').gsub(/<br\s*\/>$/, '')
|
||||
str = $2.gsub('<','<').gsub('>','>').gsub(/^\s{4}/, '').gsub(/(<br\s\/>)?$/, '')
|
||||
highlight(str, lang)
|
||||
end
|
||||
|
||||
# Regular HTML support
|
||||
input.gsub /^`{3}\s(\w+)\n(.+?)\n`{3}/m do
|
||||
lang = $1
|
||||
str = $2.gsub(/^\s{4}/, '')
|
||||
|
Loading…
Reference in New Issue
Block a user