Explorar o código

Syntax highlighting in Git docs

Jed Fox %!s(int64=5) %!d(string=hai) anos
pai
achega
bad02f87ba
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      lib/docs/filters/git/clean_html.rb

+ 2 - 0
lib/docs/filters/git/clean_html.rb

@@ -42,6 +42,8 @@ module Docs
 
         css('pre').each do |node|
           node.content = node.content.gsub("\t", ' ' * 8)
+          node['data-language'] = 'shell' if node.content.starts_with?('git ')
+          node['data-language'] = 'shell-session' if node.content[0] == '$'
         end
       end
     end