[devdocsgjs/main: 184/239] Remove redundant class removal from code samples




commit 0488073d3c22cd9f26e062b18aa5a5bf29aa542e
Author: IgnusG <6438760+IgnusG users noreply github com>
Date:   Mon Feb 21 21:40:40 2022 +0100

    Remove redundant class removal from code samples

 lib/docs/filters/tailwindcss/clean_html.rb | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/lib/docs/filters/tailwindcss/clean_html.rb b/lib/docs/filters/tailwindcss/clean_html.rb
index 7eecf562..f5ef28f6 100644
--- a/lib/docs/filters/tailwindcss/clean_html.rb
+++ b/lib/docs/filters/tailwindcss/clean_html.rb
@@ -51,28 +51,23 @@ module Docs
           node.remove
         end
 
+        # Properly format code examples
         css('code.language-html').each do |node|
           node.name = 'pre';
           node['data-language'] = 'html'
           node.parent.name = 'div';
-          node.parent['class'] = node.parent['class'].gsub(/bg-.*?\b/, ' ');
-          node.parent.parent['class'] = node.parent.parent['class'].gsub(/bg-.*?\b/, ' ');
         end
 
         css('code.language-diff').each do |node|
           node.name = 'pre';
           node['data-language'] = 'diff'
           node.parent.name = 'div';
-          node.parent['class'] = node.parent['class'].gsub(/bg-.*?\b/, ' ');
-          node.parent.parent['class'] = node.parent.parent['class'].gsub(/bg-.*?\b/, ' ');
         end
 
         css('code.language-js').each do |node|
           node.name = 'pre';
           node['data-language'] = 'js'
           node.parent.name = 'div';
-          node.parent['class'] = node.parent['class'].gsub(/bg-.*?\b/, ' ');
-          node.parent.parent['class'] = node.parent.parent['class'].gsub(/bg-.*?\b/, ' ');
         end
 
         @doc.traverse { |node| cleanup_tailwind_classes(node) }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]