Get the "raw" of the user selection (no Markdown)

A workaround that I can think of is to convert the raw post to Markdown (how, I’m not sure), look at the start and end index of the selection in the converted text, than use that to extract the section from the original text. The issue would be that I’d need to assume no characters change, i.e. Markdown replaces characters 1:1. Surely there’s a better way :thinking:?