mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-10-31 15:25:04 -04:00
Added escape for liquid tags {{ and {% so that Liquid doesn't barf when a language uses these characters. Closes #466
This commit is contained in:
parent
bfb348695f
commit
f3978d1604
@ -39,9 +39,11 @@ module HighlightCode
|
||||
linenos = options[:linenos]
|
||||
start = options[:start]
|
||||
|
||||
code = code.gsub(/{{/, '{{').gsub(/{%/, '{%')
|
||||
|
||||
if lang == 'plain'
|
||||
# Escape html tags
|
||||
code = code.gsub('<','<').gsub('>','>')
|
||||
code = code.gsub('<','<')
|
||||
elsif lang.include? "-raw"
|
||||
output = "``` #{$1.sub('-raw', '')}\n"
|
||||
output += code
|
||||
|
Loading…
Reference in New Issue
Block a user