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: Invalid link generation when using [Link to Text Fragment] extension #150

Open
gaiking-uk opened this issue Apr 11, 2023 · 5 comments
Assignees

Comments

@gaiking-uk
Copy link

Issue

The [Link to Text Fragment] extension does not seem to generate the correct text fragment links if the selected text contains "-"

Example

TextFragementLink Screenshot

System / Technical Info

  • O/S: Windows 11
  • Browser: Edge
  • Browser version: 112.0.1722.34 (Official build) (64-bit)
  • Extension version: 2.3.2
@tomayac
Copy link
Member

tomayac commented Apr 12, 2023

Indeed manually percent-encoding the - to %2D in prefix, start, and suffix makes the extension-generated link work: https://imagemagick.org/script/download.php#:~:text=x64%2Dstatic.exe-,win64%20static%20at%2016%20bits%2Dper%2Dpixel%20component%20with,-high%20dynamic%2Drange.

@tomayac
Copy link
Member

tomayac commented Apr 12, 2023

Potentially connected to #115, which likewise is about percent-encoding.

@tomayac
Copy link
Member

tomayac commented Apr 12, 2023

The requirement for percent-encoding - is specifically mentioned in the spec.

@gaiking-uk
Copy link
Author

Indeed manually percent-encoding the - to %2D in prefix, start, and suffix makes the extension-generated link work: https://imagemagick.org/script/download.php#:~:text=x64%2Dstatic.exe-,win64%20static%20at%2016%20bits%2Dper%2Dpixel%20component%20with,-high%20dynamic%2Drange.

Yeah, is weird though -- if you encode the full string (which contains multiple "-" characters) that link doesn't seem to work either, AFAICT (can tell) it seems to explicitly require that some of the "-" are encoded to %2D and some are left as "-"(?) 😐🤔

Anyway, is a bit beyond my level am afraid so will leave it in your capable hands!
-- Thanks again for replying and assisting on this so promptly! 👍🏼

@tomayac
Copy link
Member

tomayac commented Apr 12, 2023

The ones that don’t need encoding are the separators of the prefix and the suffix. See https://web.dev/text-fragments/ for a (hopefully) accessible explanation.

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

3 participants