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

feat: show link label and title #334

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

calebdw
Copy link
Contributor

@calebdw calebdw commented Aug 12, 2024

Closes #325

Hello!

This PR renders the various link attributes (if they exist) to prevent lose of context/information. It's also nice to automatically style the relevant info so the user doesn't have to manually do it when copying markdown links from other locations.

It turns out there's two other link attributes besides the url:

  • label this is the portion between the brackets (a Text child of the Link node)
  • title this is the portion between the double quotes inside the link (this is most often shown as a tooltip when hovering over the link/label)
* Links look like this [](https://example.com/)
* Links with titles look like this [](https://example.com/ "Example")
* Links with labels look like this [example](https://example.com/)
* Links with titles and labels look like this [example](https://example.com/ "Example")

image

I'm open to formatting suggestions, let me know what you think! We might could display this in a more markdown style (I kinda like this better):

image

Thanks!

@mfontanini mfontanini merged commit 66aa3a3 into mfontanini:master Aug 13, 2024
6 checks passed
@mfontanini
Copy link
Owner

Thanks!

@calebdw
Copy link
Contributor Author

calebdw commented Aug 13, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Links lose their titles
2 participants