diff options
| author | Gregory Anders <greg@gpanders.com> | 2024-07-23 20:08:03 -0500 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-07-24 09:13:12 +0200 |
| commit | 205102f37243e49fc1608635a38811ecc282d14c (patch) | |
| tree | c5ae9ccadb08d4c7a688b555f646229a7e2b0bba /queries/markdown_inline | |
| parent | bot(lockfile): update editorconfig, latex (diff) | |
| download | nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.tar nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.tar.gz nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.tar.bz2 nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.tar.lz nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.tar.xz nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.tar.zst nvim-treesitter-205102f37243e49fc1608635a38811ecc282d14c.zip | |
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.
Diffstat (limited to 'queries/markdown_inline')
| -rw-r--r-- | queries/markdown_inline/highlights.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/queries/markdown_inline/highlights.scm b/queries/markdown_inline/highlights.scm index 10bb5b060..ac99cce5f 100644 --- a/queries/markdown_inline/highlights.scm +++ b/queries/markdown_inline/highlights.scm @@ -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. |
