Commit 550869be authored by Floréal Cabanettes's avatar Floréal Cabanettes

Import ingredients: consider decimals ingredients + curved apostrophe, Fixes #9

parent 916e8697
......@@ -4383,11 +4383,11 @@ void QRecipeWriter::on_editIngr_customContextMenuRequested(const QPoint &pos)
}
}
idIngr = idIngrOrig + indent;
QRegExp ingrExp("^(\\d+) ((\\w+) ((de )|(d')))?(.+)$");
QRegExp ingrExp("^(\\d+([,.]\\d+)?) ((\\w+) ((de )|(d['’])))?(.+)$");
if (ingrExp.exactMatch(txt)) {
QString qte = ingrExp.cap(1);
QString unit = ingrExp.cap(3);
QString name = ingrExp.cap(7);
QString unit = ingrExp.cap(4);
QString name = ingrExp.cap(8);
this->insertIngredient(qte, unit, name);
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment