1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

GM: Detect properly the UserScript metadata block on parse (#1964)

Eliminates some false positives
This commit is contained in:
Marti Martz 2016-05-03 08:50:11 -06:00 committed by David Rosca
parent f93ea0e199
commit ce67c7a455

View File

@ -238,7 +238,7 @@ void GM_Script::parseScript()
const QString fileData = QString::fromUtf8(file.readAll()); const QString fileData = QString::fromUtf8(file.readAll());
QzRegExp rx(QSL("// ==UserScript==(.*)// ==/UserScript==")); QzRegExp rx(QSL("(?:^|\\n)// ==UserScript==(.*)\\n// ==/UserScript==(?:\\n|$)"));
rx.indexIn(fileData); rx.indexIn(fileData);
QString metadataBlock = rx.cap(1).trimmed(); QString metadataBlock = rx.cap(1).trimmed();