Browse Source

axios: remove code highlighting

Simon Legner 3 năm trước cách đây
mục cha
commit
40ade81c60
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      lib/docs/filters/axios/clean_html.rb

+ 4 - 0
lib/docs/filters/axios/clean_html.rb

@@ -3,6 +3,10 @@ module Docs
     class CleanHtmlFilter < Filter
       def call
         css('.links').remove
+        css('pre').each do |node|
+          node.content = node.content
+          node['data-language'] = node['class'][/lang-(\w+)/, 1]
+        end
         doc
       end
     end