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

Allow non-alphabetic characters to be used as shortcut directives. #13

Open
SinclaM opened this issue Aug 16, 2022 · 0 comments
Open

Allow non-alphabetic characters to be used as shortcut directives. #13

SinclaM opened this issue Aug 16, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@SinclaM
Copy link
Owner

SinclaM commented Aug 16, 2022

Naming collisions for shortcuts can be frustrating. #3 proposes to address this by allowing control over the shortcut name itself. But recognizing shortcuts wrapped in some delimiter, say #, would also help prevent collisions.

One possible implementation (and perhaps the best for preventing collisions) would be to postpone shortcut substitution until reaching the closing delimiter. This would, for example, prevent psi from colliding with epsilon, since a substitution would only be made when #epsilon# is written completely. This implementation, however, is a somewhat significant departure from MathQuill's "on-the-fly" shortcut substitution, and would likely require big changes to the MathQuill source code. So I think this solution is unlikely to be implemented.

Another solution would be to simply allow # (or others) to be recognized as part of a shortcut. This effectively behaves like changing the name of the shortcut (making it more specific) so as to prevent it from colliding with longer shortcuts. This could be particularly useful in with #11, allowing substitution for alt-codes. For example, #9827# -> . Or, with emojis, :hamburger: -> 🍔. This would require modyfing the MathQuill source code responsible for shortcut substitution to simply recognize these non-alphabetic characters, without changing any big picture behavior.

@SinclaM SinclaM added the enhancement New feature or request label Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant