std/xmltree/constructor macro: fix quoting in output (#26039) (#26040)

`toStrLit()` uses `repr()` internally, which forwards quotes and messes
with dashes in the output. Let's use `newStrLitNode()` directly instead.

GitHub: fixes https://github.com/nim-lang/Nim/issues/26039
(cherry picked from commit 0021205854)
This commit is contained in:
pacien
2026-07-25 17:08:45 +02:00
committed by narimiran
parent d1043b839c
commit 0c4712cbd6
2 changed files with 13 additions and 5 deletions

View File

@@ -118,3 +118,14 @@ block: #21541
doAssert temp.text == "Hello!"
temp.text = "Hola!"
doAssert temp.text == "Hola!"
block: #26039
let tree = <>rss(
"xmlns:atom" = "http://www.w3.org/2005/Atom",
<>"atom:link"(
`data-dummy` = "test",
),
)
doAssert $tree == """<rss xmlns:atom="http://www.w3.org/2005/Atom">
<atom:link data-dummy="test" />
</rss>"""