redundent / kotlin-xml-builder

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

cdata not working on specific PrintOptions parameters #26

Closed Duarte-Figueiredo closed 5 years ago

Duarte-Figueiredo commented 5 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 5 years ago

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