redundent / kotlin-xml-builder

A lightweight type safe builder to build xml documents in Kotlin
Apache License 2.0
151 stars 17 forks source link

cdata not working on specific PrintOptions parameters #26

Closed Duarte-Figueiredo closed 4 years ago

Duarte-Figueiredo commented 4 years ago

When using

val printOptions =  PrintOptions(
        pretty = true,
        singleLineTextElements = true,
    )

 xml("root") {
            "child"{
                cdata("value")
            }
}.toString(printOptions = printOptions)

it results on

<root>
    <child>value</child>
</root>

instead of

<root>
    <child><![CDATA[value]]></child>
</root>
redundent commented 4 years ago

Thanks for reporting @Duarte-Figueiredo This has been fixed in PR 25. Version 1.5.3 will be available in jcenter shortly.