Skip to content

Commit 64bb9a3

Browse files
committed
Merge pull request imathis#1141 from joelclermont/patch-1
Enable inline PHP syntax highlighting
2 parents b8a981d + 1a1c868 commit 64bb9a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/pygments_code.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def pygments(code, lang)
2222
highlighted_code = File.read(path)
2323
else
2424
begin
25-
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'})
25+
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8', :startinline => true})
2626
rescue MentosError
2727
raise "Pygments can't parse unknown language: #{lang}."
2828
end
2929
File.open(path, 'w') {|f| f.print(highlighted_code) }
3030
end
3131
else
32-
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'})
32+
highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8', :startinline => true})
3333
end
3434
highlighted_code
3535
end

0 commit comments

Comments
 (0)