1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Allow html2haml to use the Hpricot's stricter XML parsing mode.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@692 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2007-12-11 10:30:14 +00:00
parent b3ef623b3a
commit 08349dbfa8
2 changed files with 7 additions and 1 deletions

View file

@ -266,6 +266,10 @@ END
@module_opts[:rhtml] = true
end
opts.on('-x', '--xhtml', 'Parse the input using the more strict XHTML parser.') do
@module_opts[:xhtml] = true
end
super
end

View file

@ -27,7 +27,9 @@ module Haml
match_to_html(template, /<%=(.*?)-?%>/m, 'loud')
match_to_html(template, /<%(.*?)-?%>/m, 'silent')
end
@template = Hpricot(template)
method = @@options[:xhtml] ? Hpricot.method(:XML) : method(:Hpricot)
@template = method.call(template)
end
end