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

Strip whitespace for text, when generating a link #135

Open
tomayac opened this issue Apr 11, 2022 · 0 comments
Open

Strip whitespace for text, when generating a link #135

tomayac opened this issue Apr 11, 2022 · 0 comments
Assignees

Comments

@tomayac
Copy link
Member

tomayac commented Apr 11, 2022

(Migrated from @FranklinYu's GoogleChromeLabs/link-to-text-fragment#60.)

Platform

  • browser: Firefox 100.0b3 (64-bit)
  • OS: macOS 12.2.1
  • hardware: iMac 2019
  • extension version: 2.2.0

Steps to reproduce

  1. Navigate to https://unicode-table.com/en/00BE/
  2. Triple-click the paragraph “Vulgar Fraction Three Quarters. Latin-1 Supplement.” This should select (highlight) the paragraph.
  3. Generate a link with this selection via the context menu.
  4. Open the URL with Firefox. The paragraph is highlighted, as expected.
  5. Open the same URL with Chrome. The paragraph isn’t highlighted.

details

In the generated link, the text value starts with a space, which is probably because the textContent of the <p> itself starts with the space. However, Chrome might trim the space when matching. If I manually remove the %20 in text field, Chrome would be able to highlight the text, as expected. I’m not sure whether this issue counts as a bug or a feature request: it does sound broken, but technically it’s kind of expected (we might as well blame the website).

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

2 participants