History

cordova: do not clean  

Do not use core/clean_html filter.

Simon Legner committed 1 year ago

Commit 63dd3dc1 parent e68269b3 files · +12 −2Browse files

Unified · Split

3 files
  1. lib/docs/filters/cordova/clean_html_core.rb +11 −0
  2. lib/docs/filters/core/clean_html.rb +0 −1
  3. lib/docs/scrapers/cordova.rb +1 −1
lib/docs/filters/cordova/clean_html_core.rb+11−0
@@ -0,0 +1,11 @@
1+module Docs
2+ class Cordova
3+ class CleanHtmlCoreFilter < Filter
4+ def call
5+ css('script', 'style', 'link').remove
6+ xpath('descendant::comment()').remove
7+ doc
8+ end
9+ end
10+ end
11+end
lib/docs/filters/core/clean_html.rb+0−1
@@ -8,7 +8,6 @@ module Docs · 7 unmodified lines
88 xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code) and not(ancestor::div[contains(concat(" ", normalize-space(@class), " "), " prism ")])]').each do |node|
99 content = node.content
1010 next unless content.valid_encoding?
11− next if context[:clean_html_maintain_nbsp] && !content.index(" ").nil?
1211 content.gsub! %r{[[:space:]]+}, ' '
1312 node.content = content
1413 end
lib/docs/scrapers/cordova.rb+1−1
@@ -8,10 +8,10 @@ module Docs · 7 unmodified lines
88 code: 'https://github.com/apache/cordova'
99 }
1010
11+ html_filters.replace 'clean_html', 'cordova/clean_html_core'
1112 html_filters.push 'cordova/entries', 'cordova/clean_html'
1213
1314 options[:container] = '.docs'
14− options[:clean_html_maintain_nbsp] = true
1515 options[:skip] = %w(index.html)
1616
1717 options[:fix_urls] = ->(url) do