Skip to content

Commit 63dd3dc

Browse files
committed
cordova: do not clean  
Do not use core/clean_html filter.
1 parent e68269b commit 63dd3dc

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def call
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ class Cordova < UrlScraper
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

0 commit comments

Comments
 (0)