-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML Escaping #282
Comments
I'd be fine with submitting a PR for this but it probably requires some refactoring of src/core/output, so I'd rather check with your first. |
Hi, @atollk ! Regarding XML character escaping, I experimented with it in the past but ultimately chose not to implement it for a few reasons:
However, I agree that proper XML escaping might be useful for some users. {
"output": {
"xmlStyleEscape": true, // Enable XML escaping
// ... other output options ...
}
} |
Hey. Makes sense to me. Just FYI, I encountered this issue when trying to implement RAG. If it's behind a new flag anyway, I'd propose to alter the output slightly as well to make it parseable as a single XML document. As it currently stands, you always have to manually remove the first line ("This file is a merged...") and add surrounding tags around the rest. |
@atollk I hadn't tried RAG myself, so this was a blind spot for me. Would you mind also adding documentation about the new |
@atollk I'll handle the website updates tomorrow. Thank you for your contribution! |
I like the feature of having a structured output via XML. However, the string concatenation as it is done in
xmlStyle.ts
doesn't really work. XML requires escaping of certain characters: https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documentsBasically, if the repo you are reading with repomix contains an XML file itself, it will be parsed as part of the repo tree, not as file contents. The "&&" symbol that is used for boolean conjunction in many languages is disallowed in XML files entirely and will make the output invalid.
The proper solution would be to use an XML serializer that takes care of any escaping that is needed.
The text was updated successfully, but these errors were encountered: