Bug 510574 - Open Link plugin includes trailing '>' from markdown files
Summary: Open Link plugin includes trailing '>' from markdown files
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-13 18:39 UTC by Allen Winter
Modified: 2025-10-15 08:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allen Winter 2025-10-13 18:39:29 UTC
If I click on a url inside '<link>' the "Open Links" plugin tries to open the url 'link>' rather than 'link'

to reproduce:
* make sure you have the Open Link plugin enabled

* create a 1 line foo.md file with the contents:
hi <https://www.pennydellpuzzles.com/products/variety/classic-variety-puzzles-plus-crosswords/>

* open the foo.md in kate

* ctrl key over the url and click

* notice your browser tries to open the url with a trailing '>'
Comment 1 Christoph Cullmann 2025-10-14 19:38:13 UTC
I would propose to post-pass the link not just for the markdown stuff but just

static void adjustLink(QString &link)
{
    // fixup links like:
    // [ccc](https://cullmann.dev)
    // Visit 'https://cullmann.dev'
    // Visit "https://cullmann.dev"
    // The web site https://cullmann.dev.
    // <https://cullmann.dev>
    static const QRegularExpression skipSpecial(QStringLiteral("[)'\".>]$"));
    link.replace(skipSpecial, QString());
}

to kill any of these closing things at the end.
Comment 2 Christoph Cullmann 2025-10-14 19:51:36 UTC
Will try that.
Comment 3 Bug Janitor Service 2025-10-14 19:54:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1919
Comment 4 Waqar Ahmed 2025-10-15 08:06:40 UTC
Git commit 8c8d12c7da6eac81b2310d37d79f7db15da52f65 by Waqar Ahmed, on behalf of Christoph Cullmann.
Committed on 15/10/2025 at 07:01.
Pushed by waqar into branch 'master'.

better link matching if ending if braces or string/sentences end

fixup links like:
[ccc](https://cullmann.dev)
Visit 'https://cullmann.dev'
Visit "https://cullmann.dev"
The web site https://cullmann.dev.
<https://cullmann.dev>

M  +15   -14   addons/openlink/matchers.h

https://invent.kde.org/utilities/kate/-/commit/8c8d12c7da6eac81b2310d37d79f7db15da52f65