markdown-mode
markdown-mode copied to clipboard
`markdown-footnote-find-text` returns incorrect position in footnotes starting with a square bracket
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
- 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).
-
Evaluate
(markdown-footnote-find-text "^1"). -
Note that the function returns
27, when it should return26.