Browse Source

Disable clean_text filter for tailwind - we'll customise this

IgnusG 3 years ago
parent
commit
4d1c0b406b
1 changed files with 10 additions and 1 deletions
  1. 10 1
      lib/docs/scrapers/tailwindcss.rb

+ 10 - 1
lib/docs/scrapers/tailwindcss.rb

@@ -1,3 +1,11 @@
+module Docs
+  class NoopFilter < Filter
+    def call
+      return html
+    end
+  end
+end
+
 module Docs
   class Tailwindcss < UrlScraper
     self.name = 'Tailwind CSS'
@@ -9,7 +17,8 @@ module Docs
 
     html_filters.push 'tailwindcss/entries', 'tailwindcss/clean_html'
 
-    # options[:container] = 'body';
+    # Disable the clean text filter which removes empty nodes - we'll do it ourselves more selectively
+    text_filters.replace("clean_text", "noop")
 
     # Fix redirects from older tailwind 2 docs
     options[:fix_urls] = lambda do |url|