Prechádzať zdrojové kódy

Fix Cordova indents with new option

Tim Lim 1 rok pred
rodič
commit
e68269b3f4

+ 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|
       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
         content = node.content
         next unless content.valid_encoding?
         next unless content.valid_encoding?
+        next if context[:clean_html_maintain_nbsp] && !content.index(" ").nil?
         content.gsub! %r{[[:space:]]+}, ' '
         content.gsub! %r{[[:space:]]+}, ' '
         node.content = content
         node.content = content
       end
       end

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

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