As you can see, I passed in escaped html, and now it is unescaped
I found out that it replaces escaped text with unescaped in this line:
url.replaceWith(BeautifulSoup(replacement))
If we won't wrap replacement with BeautifulSoup, replaceWith() method automatically escapes the string while modifing the original soup.
I really don't see the point why the replacement is wrapped by BeautifulSoup call.
As you can see, I passed in escaped html, and now it is unescaped I found out that it replaces escaped text with unescaped in this line:
If we won't wrap
replacement
withBeautifulSoup
,replaceWith()
method automatically escapes the string while modifing the original soup. I really don't see the point why thereplacement
is wrapped byBeautifulSoup
call.