|
|
@ -8,6 +8,7 @@ module Docs
|
|
|
|
xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code) and not(ancestor::div[contains(concat(" ", normalize-space(@class), " "), " prism ")])]').each do |node|
|
|
|
|
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
|
|
|
|
content = node.content
|
|
|
|
next unless content.valid_encoding?
|
|
|
|
next unless content.valid_encoding?
|
|
|
|
|
|
|
|
next if context[:clean_html_maintain_nbsp] && !content.index(" ").nil?
|
|
|
|
content.gsub! %r{[[:space:]]+}, ' '
|
|
|
|
content.gsub! %r{[[:space:]]+}, ' '
|
|
|
|
node.content = content
|
|
|
|
node.content = content
|
|
|
|
end
|
|
|
|
end
|
|
|
|