-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish autolinks in render hook #9993
Labels
Milestone
Comments
I would mind adding a ´LinkType`, some notes:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To my understanding, at the moment markdown render hooks apply equally to the three possible kinds of links in content:
[example](https://example.com)
<https://example.com>
https://example.com
So
render-link.html
would fire for each one.For the last case WordPress has popularized the convention that bare link in content is magically turned into embedded content, for services that support such.
This creates a use case where you want to hook specifically into that case and just it, without hooking into regular links.
While this is possible to try detect it with some logic (e.g.
if eq .Destination .Text
), I think it might be beneficial to offer an explicit way to distinguish the cases. This might be done in a ways like passing.LinkType
context to the hook and/or adding more specific templates likerender-link-markup.html
/render-link-autolink.html
/render-link-autolink-extended.html
.Thank you for considering. :)
The text was updated successfully, but these errors were encountered: