-
Notifications
You must be signed in to change notification settings - Fork 14
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 breaks inserted HTML code #34
Comments
Yup, that's expected behavior. To do better, there would need to be some mechanism similar to "HTML strings" in Rails, where you mark up a string as not requiring escaping. It would have a new type now (which allows it to be detected as not needing escaping) while still behaving like a string in all other aspects. When serializing the whole tree, nodes of a raw string type would not be subjected to escaping. Emacs Lisp doesn't offer extensible types or protocols, so it has to be done slightly differently, like by wrapping such text/nodes with a Extra tests to ensure this behaves as expected are a must. I remember something about the Rails implementation to be tricky to get right, maybe its tests could be lifted. |
A dynamic variable could be a cheap short term solution, and detecting a list like I can definitely understand the need for escaping strings by default, but it'd be great to have a way to do a targeted override like you're suggesting. Thanks! |
I will take a look sometime over the next week to see if I can produce an ideal solution, if wasamasa doesn't beat me to it. (Hopefully sooner) |
Excellent, thanks a lot! |
Sorry for the delay so far. @daviwil I've looked into the problem again and it seems extremely simple if I restrict myself to the @tali713 I've added very basic tests, too. Feel free to add more esxml tests to the file to document all functionality and make refactorings more robust. |
Hi. Thank you..! |
There is no such thing as raw-string syntax for sxml, so I didn't add the functionality there. Going by https://okmij.org/ftp/Scheme/SXML.html a possible syntax would be |
Oh, sure, thanks... |
Alright, pushed. Given that 30 days passed with some positive feedback, I think this is ready for merge. |
JFYI, [in my case] it works! Perfect! Thanks a lot! |
Hi! I use this package for templating the websites I generate using Org Mode. Commit 62d66a7 broke my site generation because this package has now started to escape any HTML that is passed in as a plain-text string in the input list given to
esxml-to-xml
.Since I have to pass through HTML that is generated by Org as a body for my page templates, this causes my page bodies to be fully escaped in the generated output. Is there any way we can add an approach to bypass the escaping for cases where it really isn't needed?
Let me know if you need any further details.
Thanks!
The text was updated successfully, but these errors were encountered: