Closed madscientist159 closed 5 months ago
Should the CDATA fields be handled like this? I assumed they represented interpolated data, but it looks like they're more along the lines of "comments that will be included in the XML."
# before
<descr>
<![CDATA[User provided text goes here]]>
</descr>
# after
<descr>
User provided text goes here
</descr>
They should look more like this after. OPNsense is sensitive to newlines, pfSense apparantly wasn't.
# after
<descr>User provided text goes here</descr>
Also, the CDATA fields show up other places, including a couple of fields that are parsed (non-comment) data. They all need to be scrubbed out along with their associated newlines as above.
To make things more interesting, AFAIK a CDATA field could have newlines within the CDATA tags, and those newlines need to be preserved. :wink:
CDATA tags have now been removed, and I've added the option to download a configuration with "no formatting." When it comes to recursive string interpolation, I don't see myself getting to that anytime in the near future.
Id be surprised if opnsense cannot handle either type of import, as both are valid XML.
Older versions of pfSense tend to wrap all user strings in CDATA markers, as follows:
OPNsense doesn't know what to do with these and inserts a bunch of unwanted newlines and spaces around the user text on restore.