Open carlgieringer opened 1 year ago
If the prefix/exact/suffix starts/ends in the middle of a word, Chrome's will not scroll or highlight the text fragment.
E.g. dom-anchor-text-quote produces a prefix/suffix like the following:
https://kr.usembassy.gov/martin-luther-king-jr-dream-speech-1963/#:~:text=n%20oasis%20of%20freedom%20and%20justice.%0A-,I%20have%20a%20dream%20that%20my%20four%20little%20children%20will%20one%20day%20live%20in%20a%20nation%20where%20they%20will%20not%20be%20judged%20by%20the%20color%20of%20their%20skin%20but%20by%20their%20character.,-%0AI%20have%20a%20dream%20today.%0AI%20have%20a%20
But Chrome will only scroll to the link if we remove all newlines (%0A) and if the prefix text uses complete words (replace n%20oasis with an%20oasis.)
%0A
n%20oasis
an%20oasis
An (easy?) fix would be to expand the selection start/end not to split a word.
We could work around this by enforcing that ranges added to Howdju must start/end on a word boundary.
Relevant links:
If the prefix/exact/suffix starts/ends in the middle of a word, Chrome's will not scroll or highlight the text fragment.
E.g. dom-anchor-text-quote produces a prefix/suffix like the following:
https://kr.usembassy.gov/martin-luther-king-jr-dream-speech-1963/#:~:text=n%20oasis%20of%20freedom%20and%20justice.%0A-,I%20have%20a%20dream%20that%20my%20four%20little%20children%20will%20one%20day%20live%20in%20a%20nation%20where%20they%20will%20not%20be%20judged%20by%20the%20color%20of%20their%20skin%20but%20by%20their%20character.,-%0AI%20have%20a%20dream%20today.%0AI%20have%20a%20
But Chrome will only scroll to the link if we remove all newlines (
%0A
) and if the prefix text uses complete words (replacen%20oasis
withan%20oasis
.)An (easy?) fix would be to expand the selection start/end not to split a word.