I merged this branch as revision 8944fe70574914cabfc9e6fb6eb048d71be39fb1.
I tested this on a sample of about 1200 web pages. I parsed each document and wrote to disk the results of BeautifulSoup.encode() and BeautifulSoup,prettify(). I did this for both the current release of Beautiful Soup and my new code. I then automatically compared each "old" document to the corresponding "new" document.
The only difference is that the current release of Beautiful Soup doesn't generally end a prettified string with a newline, and my new implementation consistently does this. I think this is an improvement and that _not_ ending a prettified string with a newline represents an oversight that no one ever pointed out.
I merged this branch as revision 8944fe70574914c abfc9e6fb6eb048 d71be39fb1.
I tested this on a sample of about 1200 web pages. I parsed each document and wrote to disk the results of BeautifulSoup. encode( ) and BeautifulSoup, prettify( ). I did this for both the current release of Beautiful Soup and my new code. I then automatically compared each "old" document to the corresponding "new" document.
The only difference is that the current release of Beautiful Soup doesn't generally end a prettified string with a newline, and my new implementation consistently does this. I think this is an improvement and that _not_ ending a prettified string with a newline represents an oversight that no one ever pointed out.