I can only offer vague advice, since I’m not at my desk at the moment, but: you can use the devtools (cmd/ctrl+shift+i by default, I think) to inspect the underlying HTML. If you open that up, select some text, and then find the selected text in the DOM, you can find exactly what to target.
Obsidian is built on CodeMirror, which probably does its own thing for modeling text selection.