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) }