File: usage.rb

package info (click to toggle)
ruby-tidy 1.1.2%2Bgem2deb-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 172 kB
  • sloc: ruby: 236; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 292 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
$LOAD_PATH.unshift('./lib')
require 'tidy'
html = '<html><title>title</title>Body</html>'
xml = Tidy.open(:show_warnings=>true) do |tidy|
  tidy.options.output_xml = true
  puts tidy.options.show_warnings
  xml = tidy.clean(html)
  puts tidy.errors
  puts tidy.diagnostics
  xml
end
puts xml