Skip to content

Commit

Permalink
cordova: do not clean  
Browse files Browse the repository at this point in the history
Do not use core/clean_html filter.
  • Loading branch information
simon04 committed Nov 17, 2024
1 parent e68269b commit 63dd3dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions lib/docs/filters/cordova/clean_html_core.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Docs
class Cordova
class CleanHtmlCoreFilter < Filter
def call
css('script', 'style', 'link').remove
xpath('descendant::comment()').remove
doc
end
end
end
end
1 change: 0 additions & 1 deletion lib/docs/filters/core/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def call
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
next unless content.valid_encoding?
next if context[:clean_html_maintain_nbsp] && !content.index(" ").nil?
content.gsub! %r{[[:space:]]+}, ' '
node.content = content
end
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/cordova.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class Cordova < UrlScraper
code: 'https://github.com/apache/cordova'
}

html_filters.replace 'clean_html', 'cordova/clean_html_core'
html_filters.push 'cordova/entries', 'cordova/clean_html'

options[:container] = '.docs'
options[:clean_html_maintain_nbsp] = true
options[:skip] = %w(index.html)

options[:fix_urls] = ->(url) do
Expand Down

0 comments on commit 63dd3dc

Please sign in to comment.