Selaa lähdekoodia

typescript: clean code blocks

Simon Legner 5 vuotta sitten
vanhempi
commit
87f97d6cc0

+ 1 - 1
assets/javascripts/templates/pages/about_tmpl.coffee

@@ -783,7 +783,7 @@ credits = [
     'https://twig.symfony.com/license'
   ], [
     'TypeScript',
-    '2012-2019 Microsoft',
+    '2012-2020 Microsoft',
     'Apache',
     'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE'
   ], [

+ 7 - 0
lib/docs/filters/typescript/clean_html.rb

@@ -17,6 +17,13 @@ module Docs
           node.name = 'h1'
         end
 
+        css('a:contains("Try")').remove
+        css('pre').each do |node|
+          node.content = node.content
+          node['data-language'] = 'typescript'
+          node.remove_attribute('class')
+        end
+
         # 'Next' title area
         css('.whitespace-tight').remove