We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 13057c4 + 79d12b9 commit e4c9782Copy full SHA for e4c9782
lib/html/pipeline/syntax_highlight_filter.rb
@@ -17,9 +17,9 @@ def call
17
default = context[:highlight] && context[:highlight].to_s
18
next unless lang = node['lang'] || default
19
next unless lexer = lexer_for(lang)
20
- text = node.inner_text
21
22
- html = highlight_with_timeout_handling(text, lang)
+ text = node.inner_text
+ html = highlight_with_timeout_handling(text, lexer)
23
next if html.nil?
24
25
node.inner_html = html
@@ -32,8 +32,8 @@ def call
32
doc
33
end
34
35
- def highlight_with_timeout_handling(text, lang)
36
- Rouge.highlight(text, lang, @formatter)
+ def highlight_with_timeout_handling(text, lexer)
+ Rouge.highlight(text, lexer, @formatter)
37
rescue Timeout::Error => _
38
nil
39
0 commit comments