CDATA output containing ]]> is not well-formed XML
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start by reading XMLPrinter::PushText and the XMLDocument::NewText/SetCData path named in the issue, then reproduce the example with a]]>b. Check that the emitted XML parses and round-trips to the original text in both usage paths; done means CDATA output containing ]]> remains well-formed without changing the value.
Written by the indexing model from the issue text.
Description
On master 8224e42, writing the text a]]>b in CDATA mode produces <r><![CDATA[a]]>b]]></r>. The embedded ]]> closes the CDATA section early and the remaining ]]> is invalid character data. Python's xml.etree parser rejects the output. Normal-text mode writes <r>a]]>b</r> and round-trips the original value.
This occurs both with XMLDocument::NewText("a]]>b") followed by SetCData(true) and with XMLPrinter::PushText("a]]>b", true). XMLPrinter::PushText writes the value directly between the CDATA delimiters. Would splitting the value across adjacent CDATA sections be an acceptable fix? That can preserve the text while producing valid XML. AI-assisted investigation and reproduction.
- Dominant language
- C++
- Stars
- 5.8k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from leethomason/tinyxml2
-
New release requestOpen
leethomason/tinyxml2#1087 · 4 comments ·
-
leethomason/tinyxml2#1085 · 1 comment ·
-
New relase requestOpen
leethomason/tinyxml2#1084 ·
-
leethomason/tinyxml2#1083 ·
-
Data Corruption via Unrecognized Entity in StrPair::GetStr()Possibly taken @steps-re claimed this 93 days ago. Open
leethomason/tinyxml2#1082 ·
All issues in leethomason/tinyxml2
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
EsotericSoftware/spine-runtimes#3186 ·
-
An empty line splits a signature where an ordinary comment is right above an argument's HaddockOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mrkkrp/tilia#213 · 1 comment ·
Maintainers usually reply within 1 day
-
Round video messages start gray and blocky with libx264: encoder is configured for 1,000,000 fpsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
telegramdesktop/tdesktop#31422 ·
Maintainers usually reply within 9 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 5 days