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
3 def call3 def call
4 css('script', 'style').remove4 css('script', 'style').remove
5 xpath('descendant::comment()').remove5 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|
7 content = node.content7 content = node.content
8 next unless content.valid_encoding?8 next unless content.valid_encoding?
9 content.gsub! %r{[[:space:]]+}, ' '9 content.gsub! %r{[[:space:]]+}, ' '