gui: PreviewGeneratorPlaintext: Escape words we pass to QRegularExpression
This commit is contained in:
والد
d55187a71c
کامیت
abce4cfcd9
@ -103,7 +103,7 @@ QString PreviewGeneratorPlainText::generateLineBasedPreviewText(QTextStream &in,
|
|||||||
int foundWordsCount = 0;
|
int foundWordsCount = 0;
|
||||||
for(QString &word : config.wordsToHighlight)
|
for(QString &word : config.wordsToHighlight)
|
||||||
{
|
{
|
||||||
QRegularExpression searchRegex("\\b" + word + "\\b");
|
QRegularExpression searchRegex("\\b" + QRegularExpression::escape(word) + "\\b");
|
||||||
bool containsRegex = line.contains(searchRegex);
|
bool containsRegex = line.contains(searchRegex);
|
||||||
bool contains = false;
|
bool contains = false;
|
||||||
if(!containsRegex)
|
if(!containsRegex)
|
||||||
|
بارگذاری…
مرجع در شماره جدید
Block a user