fix(image): markdown inline link query for shortened urls (#1481)

## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
  
This fixes the `image.src` capture for markdown shortcut links, which
(imho) are links like `![[attachments/test.jpg]]`.

The current query captures also the `[...]`.

If we talk about a different type of links for this query, it would be
interesting to know which ones :).

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
This commit is contained in:
Matthias Putz 2025-10-20 14:56:50 +02:00 committed by GitHub
parent e1e30a1411
commit 2daa1b28b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,8 @@
(image
(image
[
(link_destination) @image.src
(image_description (shortcut_link (link_text) @image.src))
(image_description (shortcut_link ((link_text) @image.src)))
]
(#gsub! @image.src "|.*" "") ; remove wikilink image options
(#gsub! @image.src "^<" "") ; remove bracket link