Comments (2)
Hi, I am using this conversion when user copies the seletion to the clipboard or starts dragging (by handling copy
and dragstart
events with js, and using event.dataTransfer.setData(...)
):
without js code web browsers will put "12πi" into clipboard (text/plain), and I want to have "12/(2*pi)".
Do you know about any other solutions for this issue?
If somebody is interested I can share my selection serialization code.
P.S.
Seems, https://github.com/learningobjectsinc/mathml-to-asciimath ignores operator precedence...
from asciimathml.
Your image seems to show a selection from an equation rendered on mathjax.org so this probably belongs on the MathJax issue tracker. In any case, this won't work for several reasons.
First, MathJax output does not consist of MathML markup (except for the NativeMML output) but renders MathML (which is used internally) into HTML/CSS (or SVG but you won't get selection with SVG content in browsers so I'm assuming you are using the HTML/CSS output).
That's why the user selection is selecting HTML fragments (lots of spans basically) and as plain text this will yield a bunch of Unicode characters.
To get what you want, you would first have to get the underlying MathML, then figure out which subexpression the user selection corresponds to. That's technically not impossible (since the output has a lot of structure relating to the underlying MathML and you could do more) but there's nothing built into MathJax to do so.
After that you would tackle the topic of this issues -- convert that subexpression to asciimath.
Seems, https://github.com/learningobjectsinc/mathml-to-asciimath ignores operator precedence...
Thanks. You might want to file a bug on the repo.
from asciimathml.
Related Issues (20)
- Inconsistent whitespace sensitivity with numbers HOT 3
- Test environment 'collapses' multiple kinds of whitespace into one HOT 1
- Support more geometry symbols HOT 1
- Support physical units HOT 2
- Vec() crashes updater HOT 1
- An exception occurs when using parseMath!The attribute "mathvariant" is incorrect! HOT 1
- TextMate grammar
- Add ≢ HOT 2
- Support for \mathscr.
- Formal grammar is incomplete
- Add support for ⊈
- support for mathjax 3 HOT 1
- Make comma `,` escapable without making it a text `","` HOT 2
- Please add `∼` (tilde operator) and `≁` (not tilde) HOT 2
- Thousands separator not documented HOT 2
- AsciiMath render intermittently not triggering in dropdown menu on iOS Safari HOT 1
- MathML-Core support shipped by default in chromium 109 HOT 2
- Convert asciimath JavaScript output to PDF
- Fraction bars aren't rendered as text HOT 2
- hyperlinks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciimathml.