Kotlin / kotlinx.html

Kotlin DSL for HTML
Apache License 2.0
1.63k stars 133 forks source link

Cannot disable escaping of `&` in an attribute value #233

Closed karollewandowski closed 9 months ago

karollewandowski commented 1 year ago

I have a case where I pass an already escaped value to the attribute:

attributes["data-test"] = "Test: …"

I want it to be rendered as:

data-test="Test: …"

It is rendered as:

data-test="Test: …"

I tried:

attributes["data-test"] = "Test: \\…"

but it becomes:

data-test="Test: \…"

The context is the a tag.

e5l commented 1 year ago

Hey @karollewandowski, thanks for the PR. I will take a look

e5l commented 9 months ago

Fixed. 0.11.0 available in the maven central

prudencioj commented 4 months ago

@e5l I believe this is still an issue in 0.11.0 version.

Example: a(href = "http://github.com/user=1&team=2")

The output will be "http://github.com/user=1&team=2" which is not what we are expecting. The correct url should have "&" and not "&".

e5l commented 4 months ago

Hey @prudencioj, it looks like the separate one for the parameter. Could you log it?