t3ll icon indicating copy to clipboard operation
t3ll copied to clipboard

Possibilty to use CDATA instead of encoding entities

Open liayn opened this issue 2 years ago • 3 comments

Is it possible to create CDATA blocks instead of xml encoding the text? This would be a bit nicer to read.

Example:

<trans-unit id="cart.vatId_needed" resname="cart.vatId_needed">
  <source><![CDATA[A valid EU VAT ID is required for invoicing. Please store this in your user profile: <a class="btn btn-gray" href="%1$s">Edit Profile</a>]]></source>

vs

<trans-unit id="cart.vatId_needed" resname="cart.vatId_needed">
  <source>A valid EU VAT ID is required for invoicing. Please store this in your user profile: &lt;a class=&#34;btn btn-gray&#34; href=&#34;%1$s&#34;&gt;Edit Profile&lt;/a&gt;</source>

liayn avatar Feb 14 '23 12:02 liayn

I heard this before, unfortunately it is not a trivial task. t3ll uses the encoding/xmlpackage of the go stdlib, which does not support this, at least not currently. It either always uses CDATA or never, there is no direct way to do this conditionally, depending on the actual content.

Will keep the issue open in case I find a not-too-weird workaround to get this working.

garfieldius avatar Feb 20 '23 12:02 garfieldius

Thanks, I already suspected this to be the case.

liayn avatar Feb 22 '23 08:02 liayn