feat(markdown): set url attribute on plain URLs

Setting the url attribute on actual URLs will cause Nvim to use the OSC
8 sequence on the entire URL, which enables terminal emulators to detect
the URL even when it is wrapped.

The (uri_autolink) node must use an #offset! directive to strip the
surrounding <> characters from the URL.
This commit is contained in:
Gregory Anders 2024-07-23 20:08:03 -05:00 committed by Christian Clason
parent 9d252d0021
commit 205102f372

View file

@ -88,6 +88,13 @@
(email_autolink)
] @markup.link.url @nospell
((link_destination) @_url
(#set! @_url "url" @_url))
((uri_autolink) @_url
(#offset! @_url 0 1 0 -1)
(#set! @_url "url" @_url))
(entity_reference) @nospell
; Replace common HTML entities.