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:
parent
b3ef623b3a
commit
08349dbfa8
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue