| Summary: | The searched text in "Google Selected Text" tool should be escaped | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Maciej Libera <maciej.libera> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | christoph, nate |
| Priority: | NOR | ||
| Version First Reported In: | 19.12.1 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/kate/d198c37cdb36f1d2f8f93610dcac4d26482e8bec | Version Fixed/Implemented In: | 20.04 |
| Sentry Crash Report: | |||
|
Description
Maciej Libera
2020-01-20 21:30:00 UTC
The problem here is that %{Document:Selection:Text} is simply the raw text, not escaped.
A solution to this could be to add another variable called: %{EscapeText:<value>}, we then could write:
https://www.google.com/search?q=%{EscapeText:%{Document:Selection:Text}}
Would 'EscapeText' be the best wording, or should we more closely follow the naming 'PercentEncoded' from QUrl, see: https://doc.qt.io/qt-5/qurl.html#toPercentEncoding
If it does percent encoding, I think PercentEncoded makes the most sense. Git commit b0055e8476bb5d9a48e317230ce8becc60cf78af by Dominik Haumann. Committed on 21/01/2020 at 17:33. Pushed by dhaumann into branch 'master'. Variable expansion: Add variable PercentEncoded Summary: This can be used to encode the input text such that it can be used in URIs. This is useful e.g. for the external tool "Google Selected Text", where '&' and similar characters are problematic in the url. Test Plan: make && make test Reviewers: cullmann Reviewed By: cullmann Subscribers: kwrite-devel, kde-frameworks-devel Tags: #kate, #frameworks Differential Revision: https://phabricator.kde.org/D26812 M +4 -0 autotests/src/variable_test.cpp M +5 -0 src/utils/katevariableexpansionmanager.cpp https://commits.kde.org/ktexteditor/b0055e8476bb5d9a48e317230ce8becc60cf78af Git commit a07dceabbb02947f612bdee69da95e6bdb1de89a by Dominik Haumann.
Committed on 21/01/2020 at 18:01.
Pushed by dhaumann into branch 'external-tools-bug-416320'.
Fix External Tool "Google Selected Text"
...by using %{PercentEncoded:...} to make sure the
text is properly usable in the URI passed to the browser.
This will not be backported to 19.12, since the KTextEditor
framework only gained PercentEncoded in version 5.67.
FIXED-IN: 20.04
M +1 -1 addons/externaltools/defaultexternaltoolsrc
https://invent.kde.org/kde/kate/commit/a07dceabbb02947f612bdee69da95e6bdb1de89a
Git commit a07dceabbb02947f612bdee69da95e6bdb1de89a by Dominik Haumann.
Committed on 21/01/2020 at 18:01.
Pushed by scmsync into branch 'external-tools-bug-416320'.
Fix External Tool "Google Selected Text"
...by using %{PercentEncoded:...} to make sure the
text is properly usable in the URI passed to the browser.
This will not be backported to 19.12, since the KTextEditor
framework only gained PercentEncoded in version 5.67.
FIXED-IN: 20.04
M +1 -1 addons/externaltools/defaultexternaltoolsrc
https://commits.kde.org/kate/a07dceabbb02947f612bdee69da95e6bdb1de89a
Git commit d198c37cdb36f1d2f8f93610dcac4d26482e8bec by Dominik Haumann.
Committed on 21/01/2020 at 18:06.
Pushed by dhaumann into branch 'work-fix-bug-416509'.
Fix External Tool "Google Selected Text"
...by using %{PercentEncoded:...} to make sure the
text is properly usable in the URI passed to the browser.
This will not be backported to 19.12, since the KTextEditor
framework only gained PercentEncoded in version 5.67.
FIXED-IN: 20.04
M +1 -1 addons/externaltools/defaultexternaltoolsrc
https://invent.kde.org/kde/kate/commit/d198c37cdb36f1d2f8f93610dcac4d26482e8bec
Git commit d198c37cdb36f1d2f8f93610dcac4d26482e8bec by Dominik Haumann.
Committed on 21/01/2020 at 18:06.
Pushed by scmsync into branch 'work-fix-bug-416509'.
Fix External Tool "Google Selected Text"
...by using %{PercentEncoded:...} to make sure the
text is properly usable in the URI passed to the browser.
This will not be backported to 19.12, since the KTextEditor
framework only gained PercentEncoded in version 5.67.
FIXED-IN: 20.04
M +1 -1 addons/externaltools/defaultexternaltoolsrc
https://commits.kde.org/kate/d198c37cdb36f1d2f8f93610dcac4d26482e8bec
|