harper icon indicating copy to clipboard operation
harper copied to clipboard

Dot prefix in markdown link ancors

Open imbolc opened this issue 1 year ago • 2 comments

Image

It sees the dot as a sentence ending, if I choose to fix it I get

Image

imbolc avatar May 18 '25 09:05 imbolc

This was a little difficult to replicate, but here is a reduced example that seems to cause this:

Run [.pre-commit.sh].

[.pre-commit.sh]: https://example.com

Notably, this requires that link at the bottom, and the issue will not occur without it. This also does not occur if the label for the link at the bottom doesn't match the one in the sentence.

Interestingly, when the labels match (and we get the problematic lint) it seems that the open and close brackets in Run [.pre-commit.sh] don't get parsed. When the labels don't match on the other hand, the brackets get parsed. This is visible by running the problematic text through harper-cli spans or harper-cli parse.

86xsk avatar May 20 '25 00:05 86xsk

Out of curiosity, is it possible to put the anchor in a code block?

For example:

Run [`.pre-commit.sh`].

[`.pre-commit.sh`]: https://example.com

elijah-potter avatar Jun 19 '25 21:06 elijah-potter