-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
This took me a while to figure out, and it's possible this is a "won't fix", but curious to hear your thoughts on this issue.
I use a number of autorefs in the following format:
[`some.identifier`][]I'm not sure if that's officially supported, but it has always worked well for me, making properly hyperlinked text wrapped in <code>. I recently installed mkdocs-gallery which broke this behavior, and I eventually tracked it down to the addition of pymdownx.inlinehilite to the config. So, with the following config, the above autoref will fail:
site_name: My Docs
markdown_extensions:
- pymdownx.inlinehilite
plugins:
- mkdocstringsI tracked that down to this line:
autorefs/src/mkdocs_autorefs/references.py
Lines 56 to 61 in a6e373b
| if re.search(r"[/ \x00-\x1f]", identifier): | |
| # Do nothing if the matched reference contains: | |
| # - a space, slash or control character (considered unintended); | |
| # - specifically \x01 is used by Python-Markdown HTML stash when there's inline formatting, | |
| # but references with Markdown formatting are not possible anyway. | |
| return None, m.start(0), end |
if pymdownx.inlinehilite is not included in the config, identifier will equal 'some.identifier' at that line, re.search will not match, and the link will be created. If inlinehilight is included though, identifier will look something like '\x02wzxhzdk:1\x03', and the search will hit preventing the link.
Is this something that you can imagine a fix for? Or is the [`some.identifier`][] syntax just not supported?
thanks!