Edgewall Software

Opened 13 years ago

Closed 10 years ago

Last modified 9 years ago

#368 closed defect (fixed)

HTML("<? ?>") causes ValueError

Reported by: stou@… Owned by: cmlenz
Priority: major Milestone: 0.6.1
Component: General Version: 0.5.1
Keywords: Cc:

Description

Calling HTML("<? ?>") causes a ValueError?

Attachments (4)

genshi_HTML_PI.diff (627 bytes) - added by Neil Muller 10 years ago.
Accept empty data in processing instructions in HTMLParser
genshi_HTML_PI.2.diff (627 bytes) - added by Neil Muller 10 years ago.
less buggy version of the path
genshi_HTML_PI_with_tests.diff (1.8 KB) - added by Neil Muller 10 years ago.
Patch with extra tests
genshi_HTML_PI_with_tests.2.diff (1.8 KB) - added by Neil Muller 10 years ago.
tests should have distinct names

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by cmlenz

  • Milestone changed from 0.6 to 0.6.1

comment:2 Changed 12 years ago by Carsten Klein <carsten.klein@…>

I think that is correct. <? ?> is not a valid PI.

<?foo ?> will yield a correct object.

Changed 10 years ago by Neil Muller

Accept empty data in processing instructions in HTMLParser

comment:3 Changed 10 years ago by anonymous

'<?foo ?>' will also raise a KeyError? on current genshi trunk. Genshi assumes that all processing instructions have data attached - i.e. <?foo x > or <?page break>. This is incorrect - consider this example from the HTML 4.01 specifications (http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.3.6):

'<?experiment> ... <?/experiment>'

The genshi_HTML_PI.diff accepts empty data on PI - it doesn't break the test suite, but probably needs further testing

Changed 10 years ago by Neil Muller

less buggy version of the path

Changed 10 years ago by Neil Muller

Patch with extra tests

Changed 10 years ago by Neil Muller

tests should have distinct names

comment:4 Changed 10 years ago by hodgestar

  • Resolution set to fixed
  • Status changed from new to closed

Patch committed to trunk in r1219. Merged to 0.7.x in r1229 and to 0.6.x in r1222. Thanks!

Note: See TracTickets for help on using tickets.