yattag
yattag copied to clipboard
bad indentation with cdata
from yattag import Doc, indent
doc, tag, text = Doc().tagtext()
with tag('div'):
with tag('item'):
doc.cdata('6*9')
with tag('item'):
doc.cdata('42')
result = indent(
doc.getvalue(),
indentation = ' '*2,
)
print(result)
produces the output
<div>
<item>
<![CDATA[6*9]]></item><item><![CDATA[42]]>
</item>
</div>
expected
<div>
<item><![CDATA[6*9]]></item>
<item><![CDATA[42]]></item>
</div>