MeanderingProgrammer / render-markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
1.73k stars 38 forks source link

feature: Add hyperlink icon to `(full_reference_link)` nodes #75

Closed ValdezFOmar closed 3 months ago

ValdezFOmar commented 3 months ago

Is your feature request related to a problem? Please describe.

Reference links don't get an icon when rendered. With the following markdown file:

1. This is some [link](https://example.com) 
2. This is some [link][example-link] 

[example-link]: https://example.com

Only the first example gets an icon but not the second.

image

Describe the solution you'd like

Add the same icon use for (inline_link) nodes.

Describe alternatives you've considered

None

Additional information

Tree-sitter tree:

(document ; [0, 0] - [4, 0]
  (section ; [0, 0] - [4, 0]
    (list ; [0, 0] - [3, 0]
      (list_item ; [0, 0] - [1, 0]
        (list_marker_dot) ; [0, 0] - [0, 3]
        (paragraph ; [0, 3] - [1, 0]
          (inline ; [0, 3] - [0, 43]
            (inline ; [0, 3] - [0, 43]
              (inline_link ; [0, 16] - [0, 43]
                (link_text) ; [0, 17] - [0, 21]
                (link_destination)))))) ; [0, 23] - [0, 42]
      (list_item ; [1, 0] - [3, 0]
        (list_marker_dot) ; [1, 0] - [1, 3]
        (paragraph ; [1, 3] - [2, 0]
          (inline ; [1, 3] - [1, 36]
            (inline ; [1, 3] - [1, 36]
              (full_reference_link ; [1, 16] - [1, 36]
                (link_text) ; [1, 17] - [1, 21]
                (link_label)))) ; [1, 22] - [1, 36]
          (block_continuation)))) ; [2, 0] - [2, 0]
    (link_reference_definition ; [3, 0] - [4, 0]
      (link_label) ; [3, 0] - [3, 14]
      (link_destination)))) ; [3, 16] - [3, 35]
MeanderingProgrammer commented 3 months ago

Added here: https://github.com/MeanderingProgrammer/markdown.nvim/commit/5879827bc36830dc5516d09e7df1f365ca615047

Please update and lmk if it works!

ValdezFOmar commented 3 months ago

Thanks, it works!