> What is wrong with encoding ]]> in the XML way by using an extra > CDATA. In other words split up the CDATA section into two in the > middle of the ]]> sequence: > > import string > def encode_cdata(str): > return '<![CDATA[' + \ > string.join(string.split(str, ']]>'), ']]]]><![CDATA[>')) + \ > ']]>' If I understand what you're proposing, you're splitting a single bit of Python code into N XML elements. This requires smarts not on the decode function (where they should be, IMO), but on the XML parsing stage (several leaves of the tree have to be merged). Seems like the wrong direction to push things. Also, I can imagine cases where the app puts several scripts in consecutive CDATA elements (assuming that's legal XML), and where a merge which inserted extra ]]> would be very surprising. Maybe I'm misunderstanding you, though.... --david ascher
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4