mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 06:05:00 -05: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
6b38214a33
commit
0ce6655e02
@ -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