You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 withepsilon
, 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.The text was updated successfully, but these errors were encountered: