I have an editor that can edit the rendered html (after parsing the markdown). I want to get the correct MarkdownObject for the rendered html in my editor. The cursor position from the editor is slighty off, due to missing characters from the original markdown, which are not rendered. Here is an example:
The cursor is at position 25, the Block that gets returned from FindBlockAtPosition returns the previous blocwith a span from 0-24.
How should i go about translating the UI position to the original markdown position?
Hello, I have the following usecase:
I have an editor that can edit the rendered html (after parsing the markdown). I want to get the correct
MarkdownObject
for the rendered html in my editor. The cursor position from the editor is slighty off, due to missing characters from the original markdown, which are not rendered. Here is an example:The cursor is at position 25, the
Block
that gets returned fromFindBlockAtPosition
returns the previousbloc
with a span from 0-24.How should i go about translating the UI position to the original markdown position?