Fix filters with string containing quotes

This commit is contained in:
Zoe Roux 2024-03-26 23:40:07 +01:00
parent 78247acba7
commit bb3e57ff2a
No known key found for this signature in database

View File

@ -196,8 +196,8 @@ public abstract record Filter<T> : Filter
{ {
return ( return (
from lq in Parse.Char('"').Or(Parse.Char('\'')) from lq in Parse.Char('"').Or(Parse.Char('\''))
from str in Parse.AnyChar.Where(x => x is not '"' and not '\'').Many().Text() from str in Parse.AnyChar.Where(x => x != lq).Many().Text()
from rq in Parse.Char('"').Or(Parse.Char('\'')) from rq in Parse.Char(lq)
select str select str
).Or(Parse.LetterOrDigit.Many().Text()); ).Or(Parse.LetterOrDigit.Many().Text());
} }