Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate position from rendered HTML to markdown #770

Open
joshua211 opened this issue Feb 12, 2024 · 1 comment
Open

Translate position from rendered HTML to markdown #770

joshua211 opened this issue Feb 12, 2024 · 1 comment
Labels

Comments

@joshua211
Copy link

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?

@xoofx xoofx added the question label Feb 13, 2024
@xoofx
Copy link
Owner

xoofx commented Feb 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants