strip whitespace for text, when generating a link
FranklinYu opened this issue · 1 comments
FranklinYu commented
Platform
- browser: Firefox 100.0b3 (64-bit)
- OS: macOS 12.2.1
- hardware: iMac 2019
- extension version: 2.2.0
Steps to reproduce
- Navigate to https://unicode-table.com/en/00BE/
- Triple-click the paragraph “Vulgar Fraction Three Quarters. Latin-1 Supplement.” This should select (highlight) the paragraph.
- Generate a link with this selection via the context menu.
- Open the URL with Firefox. The paragraph is highlighted, as expected.
- 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).
tomayac commented
Closing in favor of GoogleChromeLabs/text-fragments-polyfill#135.