Skip to content
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

Special characters get double encoded in truffleruby #10

Closed
mojavelinux opened this issue Jan 19, 2019 · 7 comments
Closed

Special characters get double encoded in truffleruby #10

mojavelinux opened this issue Jan 19, 2019 · 7 comments

Comments

@mojavelinux
Copy link
Member

mojavelinux commented Jan 19, 2019

When running on truffleruby, the to_mathml method double encodes special twice.

Consider the following input text:

(::AsciiMath.parse '+-x').to_mathml

This produces:

<math><mo>&amp;#xB1;</mo><mi>x</mi></math>

instead of the expected:

<math><mo>&#xB1;</mo><mi>x</mi></math>

It's possible this is a bug in truffleruby itself.

@eregon
Copy link

eregon commented Jan 22, 2019

If TruffleRuby behaves differently than MRI, then it's most likely a bug in TruffleRuby.
Please report it to https://github.com/oracle/truffleruby/issues
A small reproducer is of course even better 😃

@pepijnve
Copy link
Member

@eregon oracle/truffleruby#1545

@mojavelinux This one looks like an issue in Truffle itself. Only workaround I can come up with is to not use String.encode.

@mojavelinux
Copy link
Member Author

@pepijnve Exactly what we needed to know. Thanks for filing the issue upstream!

@eregon While I discovered the issue in Asciidoctor, the stacktrace led to AsciiMath. So I filed the issue here to verify the source of the problem before we brought it to truffleruby. Thanks for the support!

@pepijnve
Copy link
Member

@mojavelinux FYI, I dropped MRI 1.8 support as part of this change. Semver would require me to mark the gem as 2.0, but I'm not going to do that. 1.8 is sufficiently legacy that I hope this is a non issue for people...

@mojavelinux
Copy link
Member Author

Fine by me. 👍

@pepijnve
Copy link
Member

@mojavelinux And the builds are green! 1.0.8 should be ready to go on rubygems.org.

@mojavelinux
Copy link
Member Author

Thanks @pepijnve! The upstream builds are now green too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants