mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[AutoIdentifiers] Not created when rendering a MarkdownDocument #545
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hangar18rip on GitHub (Jun 24, 2022).
Hi,
I get the following issue with the
AutoIdentifierExtension.Repro step
Using this code:
It gives me this result:
res =
<h1 id=\"hey-isabelle-nice-to-meet-you\">Hey Isabelle, nice to meet you</h1>\nres2 =
<h1>Hey Isabelle, nice to meet you</h1>\nThe content of res is the expected result.
Workaround
or
@MihaZupan commented on GitHub (Jun 24, 2022):
You have to pass the pipeline to
Markdown.Parseas well@hangar18rip commented on GitHub (Jun 24, 2022):
thanks @MihaZupan, I have it now but this was not very intuitive ;) Why should I pass the pipeline to both parse the document AND to render it. Maybe it can be a future improvment 😉
@xoofx commented on GitHub (Jun 26, 2022):
The pipeline contains both the configured parsers and the configured renderers.
For the case of the auto-identifier extension, the extension hooks into existing parsers.
5f80d86265/src/Markdig/Extensions/AutoIdentifiers/AutoIdentifierExtension.cs (L35-L51)In that case, the renderer is not modified (because the heading renderer is registered by default), but for others, they require to register their renderers as well:
5f80d86265/src/Markdig/Extensions/Abbreviations/AbbreviationExtension.cs (L15-L26)