joostkremers / pandoc-mode

An Emacs minor mode for interacting with Pandoc.
https://joostkremers.github.io/pandoc-mode/
178 stars 14 forks source link

pandoc-regex-citation-key matches url strings #121

Closed sdhoward closed 1 month ago

sdhoward commented 1 month ago

I use pandoc-mode when I'm editing markdown, and valid links that contain @ display improperly.

I dug in a little bit and there's a regex that determines when to use pandoc-citation-key-face, which makes the links look wrong.

Surely the regex shouldn't match this string:

Screenshot 2024-09-20 at 11 46 03
joostkremers commented 1 month ago

You're right, it's not. But it's not immediately clear how it can be fixed. Seems the only way is to specify that there should not be an alphanumeric character before the @ sign. I'm not sure that that will cover all cases, though. Let's run with it and see whether we get any complaints...

sdhoward commented 1 month ago

I've never seen a pandoc citation key in the wild, otherwise I would provide more feedback. The fix you provided (https://github.com/joostkremers/pandoc-mode/commit/ef84876220bdd1504b8c2432a1667d54d640522c) works for me though, thank you.

joostkremers commented 1 month ago

Great, thanks for the feedback. I'll close this issue then.