Skip to content

XML literal issue #523

Closed
Closed
@terurou

Description

@terurou

Describe the bug

haxe-formatter breaks the XML literal.

Input file

class Test {
    function main() {
        final user = "usr";

        XmlTools.toString(
            <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:foo="https://foo.bar/baz">
                <soap:Header>
                    <foo:Foo>
                        <foo:User>${user}</foo:User>
                    </foo:Foo>
                </soap:Header>
                <soap:Body>
                </soap:Body>
            </soap:Envelope>
        );
    }
}

Broken output

class Test {
    function main() {
        final user = "usr";

        XmlTools.toString( < soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
            xmlns:foo = "https://foo.bar/baz" ><soap:Header><foo:Foo><foo:User>${user} < / foo
            :User > < / foo:Foo > < / soap:Header ><soap:Body> < / soap:Body > < / soap:Envelope >);
    }
}

Expected output
Please keep valid xml.

Optional: hxformat.json

{
    "indentation": {
        "character": "    "
    },
    "sameLine": {
        "ifBody": "keep",
        "elseIf": "keep",
        "elseBody": "keep",
        "forBody": "keep",
        "whileBody": "keep"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions