Skip to content
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

Support markdown autolinks with Markdown Render Hooks #6667

Open
Brixy opened this issue Dec 25, 2019 · 3 comments
Open

Support markdown autolinks with Markdown Render Hooks #6667

Brixy opened this issue Dec 25, 2019 · 3 comments

Comments

@Brixy
Copy link

@Brixy Brixy commented Dec 25, 2019

Hugo 0.62.0

Given this render-link.html code

<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>

Markdown auto links are currently not supported.

In:

<http:/test.com>

Out:

<a href="http:/test.com">http:/test.com</a>

In (works as expected):

[Test](http:/test.com)

Out:

<a href="http:/test.com" target="_blank" rel="noopener">Test</a>

Thank you!

@Brixy Brixy added the Proposal label Dec 25, 2019
@bep bep added this to the v0.63 milestone Dec 25, 2019
@Rarst

This comment has been minimized.

Copy link

@Rarst Rarst commented Jan 2, 2020

Goldmark seems to support an even more freeform GFM autolinks without any delimiters https://github.github.com/gfm/#autolinks-extension-

Also completely un-marked-up link is a convention for automated embeds and having them run through hook would be very powerful for that purpose. Think lone twitter link by itself getting turned into full embedded tweet.

@bep bep modified the milestones: v0.63, v0.64 Jan 22, 2020
@Brixy

This comment has been minimized.

Copy link
Author

@Brixy Brixy commented Jan 23, 2020

Thanks a lot for v0.63.0!

This issue seems to be solved now, too—at least in all my use cases.

@bep bep closed this Jan 23, 2020
@matteocontrini

This comment has been minimized.

Copy link

@matteocontrini matteocontrini commented Jan 23, 2020

It doesn't seem to be fixed for me. Autolinks still don't invoke the render hook...

@bep bep reopened this Jan 23, 2020
@bep bep modified the milestones: v0.64, v0.65 Jan 30, 2020
@bep bep modified the milestones: v0.65, v0.66 Feb 18, 2020
@bep bep modified the milestones: v0.66, v0.67 Mar 2, 2020
@bep bep modified the milestones: v0.67, v0.68 Mar 9, 2020
@bep bep modified the milestones: v0.68, v0.69 Mar 20, 2020
@bep bep modified the milestones: v0.69, v0.70 Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.