markdown-mode icon indicating copy to clipboard operation
markdown-mode copied to clipboard

`markdown-footnote-find-text` returns incorrect position in footnotes starting with a square bracket

Open benthamite opened this issue 1 year ago • 0 comments

Expected Behavior

Calling markdown-footnote-find-text with a footnote whose content starts with a square bracket (such as a link) returns the first character of the text following that footnote’s identifier (i.e., the position of the bracket).

Actual Behavior

It returns the position of the character immediately following the bracket, i.e. the correct position + 1.

Steps to Reproduce

  1. Paste the following in a buffer in markdown-mode:
Hello, world![^1]

[^1]: [This is a footnote that starts with a bracket](https://www.youtube.com/watch?v=dQw4w9WgXcQ).

  1. Evaluate (markdown-footnote-find-text "^1").

  2. Note that the function returns 27, when it should return 26.

benthamite avatar Jul 19 '24 17:07 benthamite