Closed lesssn closed 6 years ago
Good idea. It's done... after a couple monthes... :) Sorry for the lag.
Hey, I noticed a similar issue with a self-closing tag and realized that maybe PyQyery.html()
uses a method of 'xml' by default still, whereas with the above commit you changed outer_html()
to have a default method of 'html'.
My use case is comparing the results of calling PyQuery.html from a whole page with PyQuery.outer_html on a portion of the page, searching for that portion, and removing it. I was having trouble getting this kind of use case to work because of the above reason. Just a thought.
When the text of the tag is empty, outer_html () outputs self-closing tag, lead to the browser may parse error.
Look from the source code is use of the etree. Tostring () method, the method of parameter "method" the default value is "XML", when set to 'HTML' can normal parsing
I wonder if there should be add the "method" parameter to outer_html() method , used to set the parse format