mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2025-01-11 13:48:37 -05:00
Merge branch '2.1' into site
This commit is contained in:
commit
23990084e2
@ -21,6 +21,7 @@ module HighlightCode
|
|||||||
else
|
else
|
||||||
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'})
|
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'})
|
||||||
end
|
end
|
||||||
|
highlighted_code = highlighted_code.gsub(/{{/, '{{').gsub(/{%/, '{%')
|
||||||
File.open(path, 'w') {|f| f.print(highlighted_code) } if path
|
File.open(path, 'w') {|f| f.print(highlighted_code) } if path
|
||||||
end
|
end
|
||||||
highlighted_code.to_s
|
highlighted_code.to_s
|
||||||
@ -44,8 +45,6 @@ module HighlightCode
|
|||||||
linenos = options[:linenos]
|
linenos = options[:linenos]
|
||||||
start = options[:start]
|
start = options[:start]
|
||||||
|
|
||||||
code = code.gsub(/{{/, '{{').gsub(/{%/, '{%')
|
|
||||||
|
|
||||||
if lang == 'plain'
|
if lang == 'plain'
|
||||||
# Escape html tags
|
# Escape html tags
|
||||||
code = code.gsub('<','<')
|
code = code.gsub('<','<')
|
||||||
|
Loading…
Reference in New Issue
Block a user