From ec9e755102219bb1f64cefcbbb80210fb9b6c704 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sat, 8 Aug 2015 12:48:46 -0400 Subject: [PATCH] Don't strip whitespace in prism.js divs --- lib/docs/filters/core/clean_html.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/filters/core/clean_html.rb b/lib/docs/filters/core/clean_html.rb index 008408a5..906b1975 100644 --- a/lib/docs/filters/core/clean_html.rb +++ b/lib/docs/filters/core/clean_html.rb @@ -3,7 +3,7 @@ module Docs def call css('script', 'style').remove xpath('descendant::comment()').remove - xpath('./text()', './/text()[not(ancestor::pre) and not(ancestor::code)]').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 next unless content.valid_encoding? content.gsub! %r{[[:space:]]+}, ' '