markdig icon indicating copy to clipboard operation
markdig copied to clipboard

Translate position from rendered HTML to markdown

Open joshua211 opened this issue 1 year ago • 1 comments

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:

image

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?

joshua211 avatar Feb 12 '24 10:02 joshua211

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.

xoofx avatar Feb 13 '24 07:02 xoofx