Bug 93087 - KTextEditor plugin: highlight web links and urls + make them clickable
Summary: KTextEditor plugin: highlight web links and urls + make them clickable
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: HI wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
: 166262 263004 399810 423906 446722 451434 457686 465264 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-11 12:19 UTC by szandor9000
Modified: 2023-04-10 14:30 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description szandor9000 2004-11-11 12:19:31 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    SuSE RPMs
OS:                Linux

A KDE text viewer that hightlights weblinks contained in the text and turns them into clickable links?
I use Kwrite for most of my general viewing and would like to see this feature included.
Comment 1 Wilbert Berendsen 2004-11-12 13:42:21 UTC
Bug #26121 has the same wish for konsole, actually i like this idea.
Comment 2 Janet 2006-05-29 15:41:15 UTC
For Windows there exists a small editor called metapad. It has this very useful feature to display links in blue to highlight them and if you click on a link it opens in your browser. I really miss this feature in kwrite too. Though I managed to create a color profile to display links in blue this way they still are not clickable.
Comment 3 Anders Lund 2006-05-29 21:20:16 UTC
This is a nice job for a plugin.
Comment 4 Randy Kramer 2006-05-30 00:41:01 UTC
On Monday 29 May 2006 09:41 am, Janet wrote:
[bugs.kde.org quoted mail]

A workaround: on my kde (not 100% sure what implements this, although I think 
it's a feature of klipper), I can select a URL in almost any application (for 
example, I do it often in nedit, which is not a kde application) and it will 
open in an existing (or sometimes a new) browser.

It's not quite as nice as clicking (I have to select the entire URL, but, on 
the other hand, I don't have to be that precise, it also seems to work if I 
select more than just the URL).

When I select a URL, in, for example nedit, a popup window opens.  The first 
line reads: 

   "We-URL: Actions for " <the URL I selected>

Subsequent lines include things like:

   Open with Konqueror
   Open with Mozilla (i.e., the two browsers I use)
   Send URL
   Send Page
   ...

This works (and seems to have been set up automatically for me) on Mandrake 
2006 which uses kde 3.4.2.

If this sounds useful to you, maybe someone else can point you to how to set 
this up.  (I'm pretty sure it's a function of klipper, but as I did not set 
it up for myself, I'm not sure what is required.)

Randy Kramer

PS: Aside: In nedit I have syntax highlighting setup so that (for some files, 
those I'm interested in) links are highlighted in blue.
Comment 5 Shriramana Sharma 2007-04-16 19:11:50 UTC
This should be changed to a wishlist item for Katepart so that Katepart makes links clickable, just like bug #29712 asks for Konsole.
Comment 6 Angel Blue01 2009-03-09 16:44:50 UTC
Yep, that's Klipper.

Still would be nice to have automatic actions in a KDE text editor though
(In reply to comment #4)
> On Monday 29 May 2006 09:41 am, Janet wrote:
> [bugs.kde.org quoted mail]
> 
> A workaround: on my kde (not 100% sure what implements this, although I think 
> it's a feature of klipper), I can select a URL in almost any application (for 
> example, I do it often in nedit, which is not a kde application) and it will 
> open in an existing (or sometimes a new) browser.
> 
> It's not quite as nice as clicking (I have to select the entire URL, but, on 
> the other hand, I don't have to be that precise, it also seems to work if I 
> select more than just the URL).
> 
> When I select a URL, in, for example nedit, a popup window opens.  The first 
> line reads: 
> 
>    "We-URL: Actions for " <the URL I selected>
> 
> Subsequent lines include things like:
> 
>    Open with Konqueror
>    Open with Mozilla (i.e., the two browsers I use)
>    Send URL
>    Send Page
>    ...
> 
> This works (and seems to have been set up automatically for me) on Mandrake 
> 2006 which uses kde 3.4.2.
> 
> If this sounds useful to you, maybe someone else can point you to how to set 
> this up.  (I'm pretty sure it's a function of klipper, but as I did not set 
> it up for myself, I'm not sure what is required.)
> 
> Randy Kramer
> 
> PS: Aside: In nedit I have syntax highlighting setup so that (for some files, 
> those I'm interested in) links are highlighted in blue.
>
Comment 7 Dominik Haumann 2011-08-12 14:09:58 UTC
*** Bug 166262 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Cullmann 2012-11-09 20:08:46 UTC

*** This bug has been marked as a duplicate of bug 86850 ***
Comment 9 Christoph Cullmann 2012-11-09 20:18:04 UTC
Used wrong bug for dupe, upsa.
Comment 10 Christoph Cullmann 2012-11-09 20:18:17 UTC
*** Bug 263004 has been marked as a duplicate of this bug. ***
Comment 11 Albert Zeyer 2014-07-03 08:50:20 UTC
What's the state here?

Can some developer maybe give some rough guidelines about what would be needed to implement this? So, maybe, some other reader here has some free time and can actually implement it.

I would even go further and make this somehow configurable/scriptable via plugins. E.g., I would like to click on `import` statements in Python files. Or I have some own file format where I use some sort of `include` with a relative filename, and I would like to be able to click on that, too.
Comment 12 Dominik Haumann 2018-10-20 17:35:20 UTC
*** Bug 399810 has been marked as a duplicate of this bug. ***
Comment 13 Dominik Haumann 2018-10-20 17:36:26 UTC
Nowadays, a plugin needs to add a KTextEditor::MovingRange to matching texts, and on hover change the MovingEanges KTextEditor::Attribute. All a simple thing.
Comment 14 Christoph Cullmann 2022-03-13 20:38:15 UTC

*** This bug has been marked as a duplicate of bug 446722 ***
Comment 15 Nate Graham 2022-03-14 15:26:58 UTC
*** Bug 451434 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2022-03-14 15:27:43 UTC
*** Bug 446722 has been marked as a duplicate of this bug. ***
Comment 17 Lothar 2022-07-31 07:20:10 UTC
*** Bug 423906 has been marked as a duplicate of this bug. ***
Comment 18 Christoph Cullmann 2022-08-28 17:38:54 UTC
*** Bug 457686 has been marked as a duplicate of this bug. ***
Comment 19 Waqar Ahmed 2023-02-09 06:37:59 UTC
*** Bug 465264 has been marked as a duplicate of this bug. ***
Comment 20 Bug Janitor Service 2023-04-03 17:44:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1180
Comment 21 Christoph Cullmann 2023-04-04 08:53:49 UTC
Git commit e4a740a664e64acc1fc884dcbf8aaa34a6aa12a3 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 04/04/2023 at 08:38.
Pushed by cullmann into branch 'master'.

Intoduce open links plugin

Simple plugin that highlights http(s) urls and allows opening the link
via QDesktopService

M  +1    -0    addons/CMakeLists.txt
A  +10   -0    addons/openlink/CMakeLists.txt
A  +292  -0    addons/openlink/OpenLinkPlugin.cpp     [License: GPL(v2.0+)]
A  +58   -0    addons/openlink/OpenLinkPlugin.h     [License: GPL(v2.0+)]
A  +9    -0    addons/openlink/OpenLinkPlugin.json

https://invent.kde.org/utilities/kate/commit/e4a740a664e64acc1fc884dcbf8aaa34a6aa12a3
Comment 22 Nate Graham 2023-04-05 21:29:12 UTC
Note that this feature has been implemented in the form of an off-by-default plugin ("Open Link"). To get this functionality, you need to enable that plugin first.

If you would like it to be enabled by default, please make your opinion known!
Comment 23 Ahmed 2023-04-10 14:30:10 UTC
It will be nice if it is enabled by default, and when you hover over the highlighted text, a tooltip appears with the text: "Press ctrl + left-click to open the link".