diff --git a/src/plugins/GreaseMonkey/gm_script.cpp b/src/plugins/GreaseMonkey/gm_script.cpp index b8c6ac2b5..4a44d402c 100644 --- a/src/plugins/GreaseMonkey/gm_script.cpp +++ b/src/plugins/GreaseMonkey/gm_script.cpp @@ -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();