lib/rack-xslview.rb in rack-xslview-0.2.5 vs lib/rack-xslview.rb in rack-xslview-0.2.6

- old
+ new

@@ -42,22 +42,16 @@ @xslt = XML::XSLT.new() @xslt.xsl = REXML::Document.new @options[:xslfile] end unless @options[:tidy].nil? - require 'tidy_ffi' input_xml = myxml.include?('http://www.w3.org/1999/xhtml') ? 0 : 1 output = myxml.include?('http://www.w3.org/1999/xhtml') ? 'output_xhtml' : 'output_xml' @options[:tidy][:input_xml] = input_xml @options[:tidy][output.to_sym] = 1 - nuxml = TidyFFI::Tidy.new(myxml, @options[:tidy]).clean nuxml = '' - if nuxml == '' - input_xml = myxml.include?('http://www.w3.org/1999/xhtml') ? '' : '-xml' -cmd = %Q~echo | tidy -asxml #{input_xml} -q --doctype "omit" --show-warnings 0 --numeric-entities 1 --drop-proprietary-attributes 1 --preserve-entities 0 --input-encoding "utf8" --char-encoding "utf8" --output-encoding "utf8" --alt-text "" --tidy-mark 0 --logical-emphasis 1 <<THISISITOKOK\n#{myxml}\nTHISISITOKOK }~ - nuxml = `#{cmd}` - myxml = nuxml unless nuxml == '' - end + nuxml = TidyFFI::Tidy.new(myxml, @options[:tidy]).clean + myxml = nuxml end @xslt.xml = myxml # If setup includes env vars to pass through as params, do so unless @options[:passenv].nil?