-
Notifications
You must be signed in to change notification settings - Fork 39
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
Option to not XML-escape text #97
Comments
Thanks for the report, and for the good sleuthing work. I agree there ought to be a better solution here. @jeffreyrosenbluth , any thoughts? I could easily imagine adding a configuration option for the SVG backend to turn off XML-escaping. But it might be nicer to control it on the level of individual strings. That is trickier though since I guess we would have to add functions like |
What would be the downside of not escaping the the text as our default? |
Backwards incompatibility, and different results for different backends. |
|
I guess that would work for everything except &. |
I tried that with a minus sign and I get |
@meygerjos That's surprising. I looked at the code in Blaze.ByteString.Builder.Html.Utf8.fromHtmlEscapedString and it seems that it should work. Can you show us an offending code snippet? |
OK, it works if I save the file in |
It would be nice if there was an option to not XML-escape text, so that special characters could be used, as in
alignedText 0 0 "Jack&Jill had 5−4 pancakes"
. Currently this renders as<text ...>Jack&amp;Jill had 5&minus;4 pancakes</text>
.I tracked down what happens to the string that is put into
alignedText
during rendering.Graphics.Rendering.SVG.renderText
sends the string (in aText
object) toGraphics.SVG.Core.toElement
, part of the svg-builder package, which runs it throughBlaze.ByteString.Builder.Html.Utf8.fromHtmlEscapedString
, which is the culprit.I'm not sure what could be done to get around this. For now my workaround is to run the svg output through
sed -i "s/\&/\&/g"
.The text was updated successfully, but these errors were encountered: