Translate position from rendered HTML to markdown
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining FindBlockAtPosition, MarkdownObject spans, and how rendered HTML positions differ from the original Markdown. Define how a rendered cursor position should map to the correct source MarkdownObject, including omitted Markdown characters; done means the reported object and span match the editor position in the provided example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100