fix: /openurl can now open urls with spaces, assuming the url allows it (#5197)
This allows for commands like `/openurl https://www.deepl.com/en/translator#auto/en/{1+}` that previously worked
This commit is contained in:
@@ -443,6 +443,8 @@ QString openURL(const CommandContext &ctx)
|
||||
}
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setOptionsAfterPositionalArgumentsMode(
|
||||
QCommandLineParser::ParseAsPositionalArguments);
|
||||
parser.addPositionalArgument("URL", "The URL to open");
|
||||
QCommandLineOption privateModeOption(
|
||||
{
|
||||
@@ -469,7 +471,7 @@ QString openURL(const CommandContext &ctx)
|
||||
"Usage: /openurl <URL> [--incognito/--no-incognito]"));
|
||||
return "";
|
||||
}
|
||||
auto urlString = parser.positionalArguments().at(0);
|
||||
auto urlString = parser.positionalArguments().join(' ');
|
||||
|
||||
QUrl url = QUrl::fromUserInput(urlString);
|
||||
if (!url.isValid())
|
||||
|
||||
Reference in New Issue
Block a user