#4661·Kavita

Annotation anchors to wrong occurrence when same text appears multiple times on the same line

Author: IrilithCreated May 1, 2026Updated Sep 26, 2026
LabelsUI

What happened?

When annotating a selected text, if the same text appears multiple times within the same line or paragraph, the annotation anchors to the first occurrence in that line rather than the actually selected one.

Given this line:

During the event[1] all players will receive an additional ten percent to their experience point gains as an event[2] bonus.

Annotating the second event places the annotation on the first event instead. Occurrences that are alone on their line are unaffected.

see video: https://file.garden/aYF_ULv7g1z31ci1/OBS/2026-05-01%2020-12-01.mp4

What did you expect?

The annotation should anchor to the exact selected text using its position/range, regardless of duplicate text on the same line.

Kavita Version Number - If you don't see your version number listed, please update Kavita and see if your issue still persists.

0.9.0 - Stable

Are you accessing kavita through a reverse proxy? If yes, confirm that the issue persists with a direct connection

Yes

What operating system is Kavita being hosted from?

Docker (LSIO Container)

If the issue is being seen on Desktop, what OS are you running where you see the issue?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Other (List in "Additional Notes" box)

If the issue is being seen on Mobile, what OS are you running where you see the issue?

None

If the issue is being seen on the Mobile UI, what browsers are you seeing the problem on?

No response

Relevant log output

bash

Additional Notes

browser: Zen tested on Brave and same issue too.

also tested on direct connection and still have the same issue