markdig
markdig copied to clipboard
Translate position from rendered HTML to markdown
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 from FindBlockAtPosition
returns the previous bloc
with a span from 0-24.
How should i go about translating the UI position to the original markdown position?
Not sure it will be possible to do anything, but it would be better to have a simple Program.cs
here that demonstrates the issue.