Browse Source

Fix Cordova indents with new option

Tim Lim 1 year ago
parent
commit
e68269b3f4
2 changed files with 2 additions and 0 deletions
  1. 1 0
      lib/docs/filters/core/clean_html.rb
  2. 1 0
      lib/docs/scrapers/cordova.rb

+ 1 - 0
lib/docs/filters/core/clean_html.rb

@@ -8,6 +8,7 @@ module Docs
       xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code) and not(ancestor::div[contains(concat(" ", normalize-space(@class), " "), " prism ")])]').each do |node|
         content = node.content
         next unless content.valid_encoding?
+        next if context[:clean_html_maintain_nbsp] && !content.index(" ").nil?
         content.gsub! %r{[[:space:]]+}, ' '
         node.content = content
       end

+ 1 - 0
lib/docs/scrapers/cordova.rb

@@ -11,6 +11,7 @@ module Docs
     html_filters.push 'cordova/entries', 'cordova/clean_html'
 
     options[:container] = '.docs'
+    options[:clean_html_maintain_nbsp] = true
     options[:skip] = %w(index.html)
 
     options[:fix_urls] = ->(url) do