Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Handle (pass-through) character and entity references in TOC parser #612
I have noticed the ampersand in a header like this:
This patch fixes this by adding
It should be Unicode already. The TOC is initially returned by Markdown and the Markdown library is all Unicode all the time. Additionally, due to a recent change, all literal strings defined in MkDocs are also Unicode as every module uses Unicode literals (
Actually, I see that the tests wrap the output with
I tried your suggestion, and you are right, however contrary to my belief markdown does not seem to convert e.g.
def test_charref(self): md = dedent(""" # Heading © 1 """) expected = dedent(""" Heading © 1 - #heading-1 """) toc = markdown_to_toc(md) self.assertEqual(text_type(toc).strip(), expected)