mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
GM: Detect properly the UserScript metadata block on parse (#1964)
Eliminates some false positives
This commit is contained in:
parent
be72477855
commit
707004a85b
@ -238,7 +238,7 @@ void GM_Script::parseScript()
|
||||
|
||||
const QString fileData = QString::fromUtf8(file.readAll());
|
||||
|
||||
QzRegExp rx(QSL("// ==UserScript==(.*)// ==/UserScript=="));
|
||||
QzRegExp rx(QSL("(?:^|\\n)// ==UserScript==(.*)\\n// ==/UserScript==(?:\\n|$)"));
|
||||
rx.indexIn(fileData);
|
||||
QString metadataBlock = rx.cap(1).trimmed();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user