Mkdocs-material: CodeHilite page in docs loads Github issue

Created on 26 Feb 2019  路  4Comments  路  Source: squidfunk/mkdocs-material

Description

The following documentation page (link) contains some weird rendering. The # character is loading Github issue links instead of simply rendering as the aforementioned character.

Expected behavior

Should only show C# and F#

Actual behavior

Renders as C#, which in turn loads a link to issue #35 of this project.

Steps to reproduce the bug

No real steps needed, happens on the documentation website: Direct link

Package versions

N/A

Project configuration

N/A

System information

  • OS: N/A
  • Browser: Tested on both Firefox and Google Chrome

All 4 comments

This looks like an issue with MagicLink's repo shorthand. It translates things like #35 to a repo's issue links. I would have thought Python Markdown would translate # before the text is evaluated, but maybe not in this situation. Most likely the pattern should be adjusted to not trigger if the sequence is part of an HTML entity.

Turns out we are running the repo shorthands before entity translation which explains why we are hitting this issue. Link shortening and link recognition must be run before entity translation, but link shorthands can (and apparently should) be run after entity translation.

A pull request that fixes this issue can be found here: https://github.com/facelessuser/pymdown-extensions/pull/509.

As already noted (thanks to @facelessuser): this is an issue with MagicLink, not Material. Please see the linked PR.

Was this page helpful?
0 / 5 - 0 ratings