(parse_amount): Ignore inline math characters that are found quotes.
This commit is contained in:
parent
7f0a1ac5a3
commit
6421f57469
1 changed files with 7 additions and 2 deletions
|
|
@ -134,12 +134,17 @@ void parse_amount(const char * text, amount_t& amt, unsigned short flags,
|
||||||
{
|
{
|
||||||
char * altbuf = NULL;
|
char * altbuf = NULL;
|
||||||
|
|
||||||
if (*text)
|
if (*text) {
|
||||||
|
bool in_quote = false;
|
||||||
for (const char * p = text + 1; *p; p++)
|
for (const char * p = text + 1; *p; p++)
|
||||||
if (is_mathchr(*p)) {
|
if (*p == '"') {
|
||||||
|
in_quote = ! in_quote;
|
||||||
|
}
|
||||||
|
else if (! in_quote && is_mathchr(*p)) {
|
||||||
text = altbuf = parse_inline_math(text);
|
text = altbuf = parse_inline_math(text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*text != '(') {
|
if (*text != '(') {
|
||||||
amt.parse(text, flags);
|
amt.parse(text, flags);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue