mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 21:37:02 +00:00
Q: Custom renderer for links? #598
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 @sommmen on GitHub (Mar 22, 2023).
Hiya,
I have a markdown string that contains links.
I'm pushing this string to Slack, but unfortunately slack has a slightly different way of formatting links:
https://api.slack.com/reference/surfaces/formatting#linking-urls
What i'd like to do is parse my string with markdig and then render a markdown string.
This seems very much possible with markdig - i think i need a custom
MarkdownObjectRenderer?I'm however a bit confused on where to even start, could someone give some guidance as how to write a custom render for some markdown objects?
What i'm thinking right now is to override the
NormalizeRenderer, and replace theLinkInlineRendererwith my own.@sommmen commented on GitHub (Mar 22, 2023):
I managed to figure it out.
Not a lot of docs, but there is a lot of code documentation and the structure is clear.
Well done with this library!
Let me know if you have some tips:
@Atulin commented on GitHub (Mar 21, 2024):
@sommmen I also found myself in need of customizing how links are rendered, and I stumbled upon this issue, but while I have no problem modifying this code to my needs, I... don't actually know how to use it, how to turn it into an extension, or even just modify the pipeline with it directly.
@sommmen commented on GitHub (Mar 21, 2024):
Good luck :)