-
Notifications
You must be signed in to change notification settings - Fork 34
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
Plugin to detect math in pasted LaTeX-like text #18
Comments
Here is an interesting but probably too-rare-to-worry-about case:
Here, a greedy approach based on common-sense heuristics might classify Some ideas for features with which to classify (weights set by intuition, not learned programmatically from data): In fact, simply threshholding |
Currently, consumers of
prosemirror-math
can set up custom paste behavior for their own configuration, but it would be helpful if we provided some tools to make it easier.So,
prosemirror-math
should export an optionalPlugin
that detects dollar signs (or another user-configurable math delimiter) in pasted plain text and converts the encompassed text to an inline or block math node.However, handling non-math dollar signs will be tricky, since it is unlikely that they will already be escaped in the pasted text. So, we will need to apply some common-sense criterion to determine whether a dollar sign corresponds to math or not. For example,
Billy has $4 and Sally has $3
. When pasting, the dollar signs should be automatically escaped byprosemirror-math
.The text was updated successfully, but these errors were encountered: