pyquery
pyquery copied to clipboard
.html() get wrong
I have some html code like: < body> < table>< /table> < div>< /div> < /body> when I use $("body").html(),it return < table >< /table >< div >< /div > # miss the '\n'
Apart from flattering HTML it also makes some magic stuff with entities - I get
< > &
in source code given by .html() - any clues why?
Should I remove entities myself?
I think it is right to return < table >< /table >< div >< /div >
, because the code written in multi-lines is the same effect with the single line code. But when I tested It works well.
>>> from pyquery import PyQuery as pq
>>> para = '''
... <html>
... <body>
... <div>xx \n yy \n zz</div>
... </body>
... </html>
... '''
>>> pq
<class 'pyquery.pyquery.PyQuery'>
>>> pq(para)
[<html>]
>>> pq(para).html()
u'\n<body>\n<div>xx \n yy \n zz</div>\n</body>\n'
>>>