mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
Can I process link targets before they're written? #620
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 @deanebarker on GitHub (Aug 22, 2023).
I would like to do some logical processing on the
HREFvalue of a link. So, if the editor enters something like:I would like to capture the
@deanevalue and do some processing on that value before it's written as theHREFattribute. I'd like to replace the value with another value.Is there a mechanism for this? I couldn't find an event. Or do I need to replace the link parser/rendering completely?
@MihaZupan commented on GitHub (Aug 22, 2023):
You can post-process the document and modify the URLs
Or if you're creating
HtmlRenderers manually, you can set theLinkRewritercallback@deanebarker commented on GitHub (Aug 22, 2023):
Works beautifully, thank you.