-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
incorrect cursor position for bold math text #4750
Comments
Is the problem that such a character 'counts' as two characters in string offsets? If so, that's intentional -- JavaScript (unfortunately) represents strings as UTF-16, so 'astral plane' characers like this take up two string indices, and short of writing our own string representation, there's not much JavaScript libraries can do about that. |
Yes, Probably Jupyter needs to convert this to/from Unicode character counts itself (so that it has an encoding-independent index). |
Thanks, CodeMirror's behavior matching underlying js details makes sense. Adding the workaround in Jupyter: jupyter/notebook#2509 |
@minrk this literally saved my life. Thanks! |
Bold math text, such as
𝐚
(MATHEMATICAL BOLD SMALL A (U+1D41A), takes up two characters in cursor calculations, but is only one character.Can be verified by inputting 𝐚 into any CodeMirror demo and calling
editor.getCursor()
. Appears to be related to #1813, possibly just another codepoint range to be added somewhere.Reported downstream at JuliaLang/IJulia.jl#541 , jupyter/jupyter_client#259
The text was updated successfully, but these errors were encountered: