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

Bug: Markdown links don't work when the the link contents are an image asset hosted on GitHub #342

Open
DenverCoder1 opened this issue Jul 18, 2023 · 0 comments

Comments

@DenverCoder1
Copy link

DenverCoder1 commented Jul 18, 2023

This is an issue I noticed with markdown on Github.com. I do not know if it is also an upstream issue. I also opened a discussion in the GitHub community.

Description

Markdown links in repositories, issues, discussions, and other locations don't link to the correct location when the the link is around an image hosted on GitHub, for example when pasted into the input box to get a https://github.com/.../.../assets/... url.

Note, most other images do work including GitHub asset urls such as https://github.com/DenverCoder1.png.

Example 1 - ✔️ Working

This example correctly links to https://github.com/DenverCoder1 when clicked and displays the image properly.

Markdown

[![Example 1](https://github.com/DenverCoder1.png?size=60)](https://github.com/DenverCoder1)

Preview

Example 1

Output

<a href="https://github.com/DenverCoder1"><img src="https://github.com/DenverCoder1.png?size=60" alt="Example 1" style="max-width: 100%;"></a>

Example 2 - ❌ Not working

This example should also link to https://github.com/DenverCoder1 but instead it goes to https://github.com/community/community/assets/20955511/22851a85-cfb8-4816-b6e5-f2044f2b06ab.

Markdown

[![Example 2](https://github.com/community/community/assets/20955511/22851a85-cfb8-4816-b6e5-f2044f2b06ab)](https://github.com/DenverCoder1)

Preview

Example 2

Expected output

<a href="https://github.com/DenverCoder1"><img src="https://github.com/community/community/assets/20955511/22851a85-cfb8-4816-b6e5-f2044f2b06ab" alt="Example 2" style="max-width: 100%;"></a>

Actual ouput

<a href="https://github.com/DenverCoder1"><gh:secured-asset-reference resource_type="UserAsset" resource_id="254099377"></gh:secured-asset-reference></a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/community/community/assets/20955511/22851a85-cfb8-4816-b6e5-f2044f2b06ab"><img src="https://github.com/community/community/assets/20955511/22851a85-cfb8-4816-b6e5-f2044f2b06ab" alt="Example 2" style="max-width: 100%;"></a>
@DenverCoder1 DenverCoder1 changed the title Bug: Markdown links in don't work when the the link contents are an image asset hosted on GitHub Bug: Markdown links don't work when the the link contents are an image asset hosted on GitHub Jul 18, 2023
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

No branches or pull requests

1 participant