rack-xslview 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/rack-xslview.rb +8 -1
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
@@ -49,7 +49,14 @@ module Rack
49
49
  output = myxml.include?('http://www.w3.org/1999/xhtml') ? 'output_xhtml' : 'output_xml'
50
50
  @options[:tidy][:input_xml] = input_xml
51
51
  @options[:tidy][output.to_sym] = 1
52
- myxml = TidyFFI::Tidy.new(myxml, @options[:tidy]).clean
52
+ nuxml = TidyFFI::Tidy.new(myxml, @options[:tidy]).clean
53
+ nuxml = ''
54
+ if nuxml == ''
55
+ input_xml = myxml.include?('http://www.w3.org/1999/xhtml') ? '' : '-xml'
56
+ 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 }~
57
+ nuxml = `#{cmd}`
58
+ myxml = nuxml unless nuxml == ''
59
+ end
53
60
  end
54
61
  @xslt.xml = myxml
55
62
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 4
9
- version: 0.2.4
8
+ - 5
9
+ version: 0.2.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Albert Lash
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-24 00:00:00 -04:00
17
+ date: 2010-05-25 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency