After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739172 - reStructuredText highlighter ignores https:// links
reStructuredText highlighter ignores https:// links
Status: RESOLVED OBSOLETE
Product: gtksourceview
Classification: Platform
Component: Syntax files
3.14.x
Other Linux
: Normal minor
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-25 15:28 UTC by Federico Bruni
Modified: 2021-07-05 11:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
https uri is not highlighted (16.05 KB, image/png)
2014-10-25 15:29 UTC, Federico Bruni
  Details
Https support added. (762 bytes, patch)
2014-11-06 13:10 UTC, Sagar Ghuge
needs-work Details | Review
Https support added. (762 bytes, patch)
2014-11-10 09:38 UTC, Sagar Ghuge
needs-work Details | Review
alternative patch (786 bytes, patch)
2015-05-21 09:00 UTC, Marius Gedminas
needs-work Details | Review
rst.lang: Add test file (1.49 KB, patch)
2016-03-20 15:31 UTC, Tobias Schönberg
committed Details | Review

Description Federico Bruni 2014-10-25 15:28:53 UTC
The reStructuredText synthax highlighter has a minor bug: the https:// links are not highlighted as links (see attached screenshot).
Comment 1 Federico Bruni 2014-10-25 15:29:47 UTC
Created attachment 289313 [details]
https uri is not highlighted
Comment 2 Sébastien Wilmet 2014-10-25 16:33:00 UTC
Thank you for the bug report. A patch would be welcomed.
Comment 3 Sagar Ghuge 2014-11-06 13:10:57 UTC
Created attachment 290099 [details] [review]
Https support added.
Comment 4 Sagar Ghuge 2014-11-06 13:15:33 UTC
Also there is one more problem : it doesn't highlight the link which contains the "_" symbol. 

consider this example : https://bugzilla.gnome.org/show_bug.cgi?id=73917.
Comment 5 Sébastien Wilmet 2014-11-06 16:07:00 UTC
Review of attachment 290099 [details] [review]:

Thank you for the patch.

Maybe def.lang has already a context for URLs?
The parenthesis around "http" and "file" are not needed. For adding https, you can write "https?".
Comment 6 Sagar Ghuge 2014-11-10 09:38:11 UTC
Created attachment 290323 [details] [review]
Https support added.
Comment 7 Sébastien Wilmet 2015-01-13 12:32:31 UTC
Review of attachment 290323 [details] [review]:

Thank you for the patch.

Maybe def.lang has already a context for URLs?
The parenthesis around "http" and "file" are not needed. For adding https, you
can write "https?".
Comment 8 Sagar Ghuge 2015-01-13 13:00:36 UTC
def.lang has URLs and it has an entry for "https?" still don't work. 

I am not familiar reg ex. but keeping https? in rst.lang resolve the problem. 

Correct me if I am doing something wrong.
Comment 9 Federico Bruni 2015-01-21 14:06:22 UTC
Yes, https? is working

Regarding comment 4, there must be some conflicting rule which is triggered by the presence of an underscore (named hyperlinks?). Example:

http://example.com/hello_world

It's highlighted in green from first world up to _
Comment 10 Marius Gedminas 2015-05-21 09:00:03 UTC
Created attachment 303730 [details] [review]
alternative patch

As comment 7 says, def.lang defines a regexp for URLs, we just need to use it.
Comment 11 Sébastien Wilmet 2015-05-22 09:33:07 UTC
Review of attachment 303730 [details] [review]:

Looks good. Can you add a test to tests/syntax-highlighting/?
Comment 12 Tobias Schönberg 2016-03-20 15:31:14 UTC
Created attachment 324364 [details] [review]
rst.lang: Add test file

Currently there is no test file for reStructuredText.
This patch adds a file with a few examples.
Comment 13 Sébastien Wilmet 2016-03-27 05:05:27 UTC
Review of attachment 324364 [details] [review]:

++
Comment 14 Sébastien Wilmet 2016-03-27 05:08:08 UTC
Comment on attachment 324364 [details] [review]
rst.lang: Add test file

Attachment 324364 [details] pushed as 82a29c4 - rst.lang: Add test file
Comment 15 GNOME Infrastructure Team 2021-07-05 11:02:19 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/

Thank you for your understanding and your help.