GNOME Bugzilla – Bug 739172
reStructuredText highlighter ignores https:// links
Last modified: 2021-07-05 11:02:19 UTC
The reStructuredText synthax highlighter has a minor bug: the https:// links are not highlighted as links (see attached screenshot).
Created attachment 289313 [details] https uri is not highlighted
Thank you for the bug report. A patch would be welcomed.
Created attachment 290099 [details] [review] Https support added.
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.
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?".
Created attachment 290323 [details] [review] Https support added.
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?".
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.
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 _
Created attachment 303730 [details] [review] alternative patch As comment 7 says, def.lang defines a regexp for URLs, we just need to use it.
Review of attachment 303730 [details] [review]: Looks good. Can you add a test to tests/syntax-highlighting/?
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.
Review of attachment 324364 [details] [review]: ++
Comment on attachment 324364 [details] [review] rst.lang: Add test file Attachment 324364 [details] pushed as 82a29c4 - rst.lang: Add test file
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.