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 @@
1module 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
11end
lib/docs/filters/core/clean_html.rb+0−1
@@ -8,7 +8,6 @@ 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?
12 content.gsub! %r{[[:space:]]+}, ' '11 content.gsub! %r{[[:space:]]+}, ' '
13 node.content = content12 node.content = content
14 end13 end
lib/docs/scrapers/cordova.rb+1−1
@@ -8,10 +8,10 @@ module Docs · 7 unmodified lines
8 code: 'https://github.com/apache/cordova'8 code: 'https://github.com/apache/cordova'
9 }9 }
10 10
11 html_filters.replace 'clean_html', 'cordova/clean_html_core'
11 html_filters.push 'cordova/entries', 'cordova/clean_html'12 html_filters.push 'cordova/entries', 'cordova/clean_html'
12 13
13 options[:container] = '.docs'14 options[:container] = '.docs'
14 options[:clean_html_maintain_nbsp] = true
15 options[:skip] = %w(index.html)15 options[:skip] = %w(index.html)
16 16
17 options[:fix_urls] = ->(url) do17 options[:fix_urls] = ->(url) do