Explorar o código

axios: remove code highlighting

Simon Legner %!s(int64=3) %!d(string=hai) anos
pai
achega
40ade81c60
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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