Comment 1 for bug 1294315

Revision history for this message
Martijn Pieters (mjpieters) wrote :

The work-around is to use BeautifulSoup.new_string():

>>> comment = soup.new_string('42', Comment)
>>> soup.find('div').insert_after(comment)

but this is rather counter-intuitive; I still feel NavigableString.__new__ could handle this implementation detail for us; Tag.__init__ does this already.