-
Notifications
You must be signed in to change notification settings - Fork 41
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
feature idea: favicons #245
Comments
Links currently support custom lua patterns on the destination that let you use different icons under require('render-markdown').setup({
link = {
custom = {
youtube = { pattern = 'www%.youtube%.com/', icon = ' ', highlight = 'RenderMarkdownLink' },
},
},
}) Is this the feature you're looking for? If you have suggestions for more out of the box domains (which I think is what you're getting at) LMK and I can expand the default configuration. |
## Details Request: #245 Adds support for several URLs out of the box in addition to default web: - youtube.com - github.com - neovim.io - stackoverflow.com - discord.com - reddit.com 2 other changes have been made to make configuring custom links easier: - The highlight gets pulled from the top level `link.highlight` option if a link specific one is not specified. This makes it so you don't need to copy `RenderMarkownLink` repeatedly while being backwards compatible and allowing users to override behavior. - When multiple patterns match a link we break ties by picking the longer pattern, idea being more specific pattern = longer pattern. However patterns can be long for other reason like the original default web pattern `^http[s]?://`, to make overriding this value more likely the pattern has been shortened to `^http`.
Added these here: 61850bf, thanks! Mostly the same as what you have, but I did change some of the icons to When multiple patterns match a custom link destination, like with This is to make the behavior more likely to be consistent and will probably do the right thing in most cases, since longer patterns tend to be more specific. But in this case the shortened form of the |
Thank you!
Just a minor nit: May I suggest changing this behavior, e.g. by using a In any case, I think this issue can be closed, since it has been addressed. :) |
I considered adding a more explicit I liked the idea of having things work how you would expect out of the box. Like if you specify overlapping patterns you probably want the one with more overlap to be used, definitely some edge cases with this approach. If it comes up as a problem again definitely LMK! |
Well, as I was trying to say, the current way does not work how I expected out of the box, with the pattern behavior appearing buggy at first.
In general, this is actually reasonable, yeah. Maybe simply documenting this behavior in a short one-liner might be helpful, so that there is no confusion like I had? |
Makes sense, added documentation: 8790a38 |
Is your feature request related to a problem? Please describe.
This is just a basic idea, but when using Obsidian, I really enjoyed using the favicon plugin. I was wondering whether render-markdown could maybe achieve a similar thing?
Describe the solution you'd like
fetching and displaying favicons inline could be tricky, but it appears that there are nerdfont icons for a lot of common websites (github, stackoverflow, slack, etc.). Just handling them should already cover a large number of links. The favicon could replace
🌐
, and the globe icon is only used as fallback if the site does not have a nerdfont favicon.Describe alternatives you've considered
not aware of any.
Additional information
No response
The text was updated successfully, but these errors were encountered: