Pārlūkot izejas kodu

axios: remove code highlighting

Simon Legner 3 gadi atpakaļ
vecāks
revīzija
40ade81c60
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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