-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Charges not behaving as expected #9
Comments
Regex doesn't have a concept of valence electrons so you'll probably want to either format it manually or use brackets |
How do you use brackets with it? Or do you mean bracket with #super[] Having looked at it, your package knows what elements are. Would a regex expression that knew if you had a charge and it would know it would be, be possible? Like metals are all fairly simple because they aren't diatomic. If there is metal, a number, and then a charge, it would always be an ion. For the nonmetal ions, they would need to be disambiguated from their polyatomic forms but if the pattern is single nonmetal, a number, then a charge then it would be a charge on an ion. For polyatomic ions, I wonder if a mcchem style of using carets would do the trick. Beyond what they do, If there is any number between the caret and the charge, I would think to would only possibly be a charge and so that pattern could safely be lifted. Here is a bit of code that explains what I mean about the carets:
That said wouldn't it be cool if it had like a list in your repository that people could add ions to with the correct formatting that is triggered by typing them in the laziest way possible as I did in my example from earlier. Anyway, thanks for the response. I'm really satisfied with your package so far. One final thing, I think
would be a nice little perk in your package. |
There is an issue when one tries to add charges. A single charge works fine, but when you try to add multiple you get issues.
The text was updated successfully, but these errors were encountered: