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 f778374 + 95350d7 commit b376452Copy full SHA for b376452
lib/html/pipeline/syntax_highlight_filter.rb
@@ -19,11 +19,12 @@ def call
19
html = highlight_with_timeout_handling(lexer, text)
20
next if html.nil?
21
22
- node = node.replace(html).first
23
- klass = node["class"]
24
- klass = [klass, "highlight-#{lang}"].compact.join " "
+ if (node = node.replace(html).first)
+ klass = node["class"]
+ klass = [klass, "highlight-#{lang}"].compact.join " "
25
26
- node["class"] = klass
+ node["class"] = klass
27
+ end
28
end
29
doc
30
0 commit comments