History

Don't strip whitespace in prism.js divs

Thibaut committed 11 years ago

Commit ec9e7551 parent c6913601 file · +1 −1Browse files

Unified · Split

lib/docs/filters/core/clean_html.rb+1−1
@@ -3,7 +3,7 @@ module Docs · 2 unmodified lines
33 def call
44 css('script', 'style').remove
55 xpath('descendant::comment()').remove
6− xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code)]').each do |node|
6+ xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code) and not(ancestor::div[contains(concat(" ", normalize-space(@class), " "), " prism ")])]').each do |node|
77 content = node.content
88 next unless content.valid_encoding?
99 content.gsub! %r{[[:space:]]+}, ' '