Edgewall Software

Opened 11 years ago

Closed 11 years ago

#575 closed defect (invalid)

Proper serialization of <script ..></script>

Reported by: anonymous Owned by: cmlenz
Priority: minor Milestone:
Component: Serialization Version: 0.5.1
Keywords: Cc:

Description

Take this example:

>>> tmpl = MarkupTemplate('<script src="jquery.js"></script>')
>>> stream = tmpl.generate()
>>> print stream        
<script src="jquery.js"/>

The </script> tag is required for proper operation. I have a quick fix for now, but I feel Genshi should handle this pretty common HTML.

>>> tmpl = MarkupTemplate('<script src="jquery.js"> </script>')
>>> stream = tmpl.generate()
>>> print stream
<script src="jquery.js"> </script>

Change History (2)

comment:1 Changed 11 years ago by anonymous

Instead, should use Stream.render('html') or .render('xhtml'). print stream is the same as .render('xml').

>>> tmpl = MarkupTemplate('<script src="jquery.js"></script>')
>>> stream = tmpl.generate()
>>> stream.render('html')
'<script src="jquery.js"></script>'
>>> tmpl = MarkupTemplate('<script src="jquery.js"></script>')
>>> stream = tmpl.generate()
>>> stream.render('xhtml')
'<script src="jquery.js"></script>'

ref ApiDocs/0.6.x/genshi.core.

comment:2 Changed 11 years ago by hodgestar

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.