소스 검색

Syntax highlighting in Git docs

Jed Fox 5 년 전
부모
커밋
bad02f87ba
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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