lib/avv2word/document.rb in avv2word-1.1.13 vs lib/avv2word/document.rb in avv2word-1.1.14

- old
+ new

@@ -106,10 +106,10 @@ def replace_files(html, extras = false) html = '<body></body>' if html.nil? || html.empty? header_html = (html =~ /(<header>.*?<\/header>)/m ? $1 : '') footer_html = (html =~ /(<footer>.*?<\/footer>)/m ? $1 : '') - original_source = Nokogiri::HTML(html.gsub(/>\s+</, '><')) + original_source = Nokogiri::HTML(html.gsub(/>[\t\n\r\f]+</, '><')) # whitespace characters without space; nokogiri changes &nbsp; to \u00a0 header = Nokogiri::HTML(header_html.gsub(/>\s+</, '><')) footer = Nokogiri::HTML(footer_html.gsub(/>\s+</, '><')) @header = (header_html.empty? ? false : true) @footer = (footer_html.empty? ? false : true) transform_and_replace(header, xslt_path('header'), Document.header_xml_file)