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

shorten-links shortens a link in a pre incorrectly #5630

Closed
2 of 4 tasks
NickBolles opened this issue May 18, 2022 · 3 comments · Fixed by #5638
Closed
2 of 4 tasks

shorten-links shortens a link in a pre incorrectly #5630

NickBolles opened this issue May 18, 2022 · 3 comments · Fixed by #5638
Assignees

Comments

@NickBolles
Copy link

NickBolles commented May 18, 2022

Please ensure:

  • The bug is caused by Refined GitHub. It doesn't happen if I disable the extension.
  • The bug happens after clearing extension cache. The "Clear cache" button below can also be found at the bottom of the options page.

Example URLs

The issue I'm making

Extension version

22.4.21

Browser(s) used

Edge

Description

here's a very similar markdown segment as what I have in a PR comment. The github link in this case links to my user, instead of the full URL, which I want to show so that the command is copy/paste-able. I'm not 100% clear on if this is a bug or not, but if not I'd like to be able to disable shortening on this <pre> element as most of our team uses refined github and we'd like to be able to copy/paste this command

table
ruby run.rb linky \
  --host https://github.com/NickBolles \
  --version 12345 \
  -e stage

Exact same code outside of a table:

ruby run.rb linky \
  --host https://github.com/NickBolles \
  --version 12345 \
  -e stage

Include in this issue:

  • Screenshots/video/gif demonstrating the bug, if it’s visual
  • Console errors, if any
@cheap-glitch
Copy link
Member

This is indeed a bug, thanks for reporting! shorten-links should not affect links inside code blocks.

I think the bug comes from the fact that the block is inside a table, which afaik was never tested for.

@NickBolles
Copy link
Author

NickBolles commented May 18, 2022

I'm glad I posted my full repro then :) I just added an example with the same code outside of the table.

@fregante fregante self-assigned this May 20, 2022
@fregante
Copy link
Member

The interesting part is that GitHub is linkifying the URL in the table but not the other code block 🤷‍♂️

Fixing

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

Successfully merging a pull request may close this issue.

3 participants