Do not use core/clean_html filter.
Unified · Split
| @@ -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 | ||
| @@ -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.content | 9 | 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 = content | 12 | node.content = content |
| 14 | end | 13 | end |
| @@ -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) do | 17 | options[:fix_urls] = ->(url) do |