Escaped angle brackets are converted to < and > inside pre and code tags
Bug #2062029 reported by
Alok Hota
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Take HTML data like the following:
###
<pre>
#include <iostream>
std::cout << "Hello, world" << std::endl;
</pre>
###
and
###
<code>&
###
The angle brackets are significant here for C++ syntax. BeautifulSoup will convert these to "<iostream>" inside the HTML as if it was a tag, which of course it isn't. This leads to the text not being displayed at all in the browser.
To post a comment you must log in.
Sorry, forgot to mention this occurs when running prettify(). Just doing a decode() works as expected.