Преглед изворни кода

Don't strip whitespace in prism.js divs

Thibaut пре 10 година
родитељ
комит
ec9e755102
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/docs/filters/core/clean_html.rb

+ 1 - 1
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:]]+}, ' '