History

Fix Cordova indents with new option

Tim Lim committed 2 years ago

Commit e68269b1 parent 887c8792 files · +2 −0Browse files

Unified · Split

2 files
  1. lib/docs/filters/core/clean_html.rb +1 −0
  2. lib/docs/scrapers/cordova.rb +1 −0
lib/docs/filters/core/clean_html.rb+1−0
@@ -8,6 +8,7 @@ module Docs · 7 unmodified lines
8 xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code) and not(ancestor::div[contains(concat(" ", normalize-space(@class), " "), " prism ")])]').each do |node|8 xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code) and not(ancestor::div[contains(concat(" ", normalize-space(@class), " "), " prism ")])]').each do |node|
9 content = node.content9 content = node.content
10 next unless content.valid_encoding?10 next unless content.valid_encoding?
11 next if context[:clean_html_maintain_nbsp] && !content.index(" ").nil?
11 content.gsub! %r{[[:space:]]+}, ' '12 content.gsub! %r{[[:space:]]+}, ' '
12 node.content = content13 node.content = content
13 end14 end
lib/docs/scrapers/cordova.rb+1−0
@@ -11,6 +11,7 @@ module Docs · 10 unmodified lines
11 html_filters.push 'cordova/entries', 'cordova/clean_html'11 html_filters.push 'cordova/entries', 'cordova/clean_html'
12 12
13 options[:container] = '.docs'13 options[:container] = '.docs'
14 options[:clean_html_maintain_nbsp] = true
14 options[:skip] = %w(index.html)15 options[:skip] = %w(index.html)
15 16
16 options[:fix_urls] = ->(url) do17 options[:fix_urls] = ->(url) do