News for hackers. Stuff that matters.
Re:NestedText, a nice alternative to JSON, YAML, TOML by sergeykish on Sunday October 04, 2020 @02:46AM (#24676978)
You don't embed plain text XML in CDATA, right? You escape it

    function escapeXml(unsafe) {
        return unsafe.replace(/[<>&'"]/g, function (c) {
            switch (c) {
                case '<': return '&lt;';
                case '>': return '&gt;';
                case '&': return '&amp;';
                case '\'': return '&apos;';
                case '"': return '&quot;';
            }
        });
    }
Or you convert to the same encoding, strip XML declaration, expand entities. In short work with adequate tools.

There are no comments on this comment yet.