question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`shorten-links` conflicts with OctoLinker

See original GitHub issue

Please ensure:

  • The bug is caused by Refined GitHub. It doesn’t happen if I disable the extension.

Description

It seems OctoLinker will linkies the code and shorten-links kicks in, potentially making the code invalid.

Worth noting that OctoLinker also linkies code blocks in (Markdown) documents (e.g. https://github.com/oakserver/oak#application-middleware-and-context), but Refined GitHub doesn’t process those links.

Screenshot

image

Note the https:// prefix is stripped

Console errors

No response

Example URL

https://github.com/oakserver/oak/blob/main/deps.ts

Browser(s) used

Chrome

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cheap-glitchcommented, Mar 8, 2022

Second fix: Exclude .octolinker-link from linkify-code

I’ve got a tentative fix for that, but I’m not sure if it’s worth the trouble since RGH is almost always faster than OctoLinker. So the fix should probably happen over there.

Plus the “double link” bug has actually existed for a while (it was mentioned in the body of #4759), but it doesn’t seem to break anything (yet).

1reaction
fregantecommented, Mar 5, 2022

I think it’s because both OctoLinker and RGH are linkifying that URL and then shorten-links will shorten OctoLinker’s link. It just depends on who gets there first:

Screen Shot Screen Shot 1
  1. Quick fix for now: Also exclude .octolinker-link from shorten-links
  2. Second fix: Exclude .octolinker-link from linkify-code
  3. Better fix: Exclude links in code from shorten-links… we did this before and we probably lost it in some optimization. The complex part is that some “code” block has comments in it which can have further code. Honestly I think we need tests for this.
  4. OctoLinker fix: If it finds a Refined GitHub link, it should replace it
Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto linkify shouldn't work in code blocks in markdown · Issue #938 ...
shorten-links conflicts with OctoLinker #4758. Closed. 1 task. Sign up for free to join this conversation on GitHub. Already have an account?
Read more >
OctoLinker — Links together, what belongs together.
OctoLinker is a browser extension for GitHub, that turns language-specific statements like include require or import into links.
Read more >
OctoLinker - Twitter
The OctoLinker browser extension is the easiest and best way to navigate between ... If you have been experiencing problems with OctoLinker for...
Read more >
sindresorhus/refined-github (Raised $2,687.94) - Issuehunt
`shorten-links` conflicts with OctoLinker. Unfunded#4758created bykidonng. $0.00. The extensión does not allow me to upload files from the clipboard.
Read more >
OctoLinker
OctoLinker – Links together, what belongs together. OctoLinker – a browser extension for GitHub Navigate through projects on GitHub.com ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found