mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
Bugfix: handling of Sieve GrammarQuotedString
This commit is contained in:
parent
64ae3a281f
commit
37938d82b8
2 changed files with 7 additions and 2 deletions
|
|
@ -271,10 +271,14 @@ GrammarStringList.fromString = list => {
|
||||||
|
|
||||||
export class GrammarQuotedString extends GrammarString
|
export class GrammarQuotedString extends GrammarString
|
||||||
{
|
{
|
||||||
|
constructor(value = '')
|
||||||
|
{
|
||||||
|
super(value instanceof GrammarQuotedString ? value.value : value);
|
||||||
|
}
|
||||||
|
|
||||||
toString()
|
toString()
|
||||||
{
|
{
|
||||||
return '"' + this._value.replace(/[\\"]/g, '\\$&') + '"';
|
return '"' + this._value.replace(/[\\"]/g, '\\$&') + '"';
|
||||||
// return '"' + super.toString().replace(/[\\"]/g, '\\$&') + '"';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,8 @@ export const parseScript = (script, name = 'script.sieve') => {
|
||||||
pushArg(GrammarMultiLine.fromString(value));
|
pushArg(GrammarMultiLine.fromString(value));
|
||||||
break;
|
break;
|
||||||
case T_QUOTED_STRING:
|
case T_QUOTED_STRING:
|
||||||
pushArg(new GrammarQuotedString(value.slice(1,-1)));
|
try { value = JSON.parse(value); } catch(e) { console.error(e, value); }
|
||||||
|
pushArg(new GrammarQuotedString(value));
|
||||||
break;
|
break;
|
||||||
case T_NUMBER:
|
case T_NUMBER:
|
||||||
pushArg(new GrammarNumber(value));
|
pushArg(new GrammarNumber(value));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue