Ticket #102 (new defect)

Opened 12 months ago

output error on quoted attribute values

Reported by: ara_vartanian Owned by: why
Priority: major Milestone: 0.6
Component: ext/hpricot_scan Version:
Keywords: Cc:

Description

Single-Quoted attribute values revert to a double quoted style when a document is outputted. However, quotes within the attribute are not escaped, leading to ill-formed HTML output. Here is an example:

require 'rubygems'
require 'hpricot'

html = <<END
<span style='font:7.0pt "Times New Roman"'>&nbsp;</span>
END

document = Hpricot(html)
puts document.to_html

which will output:

<span style="font:7.0pt "Times New Roman"">&nbsp;</span>
Note: See TracTickets for help on using tickets.