Skip to content

Commit bad02f8

Browse files
committed
Syntax highlighting in Git docs
1 parent 7d04a30 commit bad02f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/docs/filters/git/clean_html.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def other
4242

4343
css('pre').each do |node|
4444
node.content = node.content.gsub("\t", ' ' * 8)
45+
node['data-language'] = 'shell' if node.content.starts_with?('git ')
46+
node['data-language'] = 'shell-session' if node.content[0] == '$'
4547
end
4648
end
4749
end

0 commit comments

Comments
 (0)