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

RecipeManager.parse_ingredient does not handle decimal values correctly #79

Open
cydanil opened this issue May 18, 2020 · 0 comments
Open
Labels

Comments

@cydanil
Copy link
Collaborator

cydanil commented May 18, 2020

In the record card, it's possible to write a line for an ingredient, in a semi free format:

1.5 cup oil
1 c. oil
1.5 c. oil
4/5 tsb. oil

However, the parser for this content is broken, due to an incorrect regex, and returns something along the lines of: {'amount': '1', 'unit': '.5', 'ingredient': '.c oil'}

This is an old issue that has already been present in previous releases of Gourmet.

The regex is defined here, of which the faulty sub-regex is defined here.

Moreover, commas in decimal values (eg. 1,5) are not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant