Skip to content

Commit 7ffb1cf

Browse files
committed
Added better support for XML, tag and attribute case is now kept. See issue haml#62
1 parent ae23615 commit 7ffb1cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: lib/html2haml/html.rb

+4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ def detect_proper_parser(template)
159159
return Nokogiri.HTML(template).at('/html').children
160160
end
161161

162+
if template =~ /^\s*<\?xml/i
163+
return Nokogiri.XML(template)
164+
end
165+
162166
parsed = Nokogiri::HTML::DocumentFragment.parse(template)
163167

164168
#detect missplaced head or body tag

0 commit comments

Comments
 (0)