mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Handle nested CDATA from nested templates
When putting CDATA into the output, any instances of ']]>' in the text are replaced with ']]]]><![CDATA[>'. This allows nested templates, e.g. from list views inside list views to work properly.
This commit is contained in:
parent
394014429e
commit
f93d5d2acd
1 changed files with 1 additions and 0 deletions
|
@ -73,6 +73,7 @@ class XmlEmitter:
|
||||||
self._needs_newline = False
|
self._needs_newline = False
|
||||||
|
|
||||||
def put_cdata(self, text: str):
|
def put_cdata(self, text: str):
|
||||||
|
text = text.replace("]]>", "]]]]><![CDATA[>")
|
||||||
self.result += f"<![CDATA[{text}]]>"
|
self.result += f"<![CDATA[{text}]]>"
|
||||||
self._needs_newline = False
|
self._needs_newline = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue