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

Add a method that returns information about the block a given line belongs to #42

Open
aplteam opened this issue Feb 18, 2024 · 0 comments

Comments

@aplteam
Copy link
Owner

aplteam commented Feb 18, 2024

Imagine a user is editing a large markdown document. She changes a line in the document and then wants the editor to update a preview. Currently the whole document must be converted. That can result in a significant delay depending on the size of the document.

With the proposed method, only the affected block could be rendered again, which should result in a significant performance improvement.

Such a method requires two arguments:

  1. A ref pointing to a variable with the markdown
  2. An index (single positive integer) pointing into the variable: the current row

It should return two positive integers:

  1. Starting row: where does the block start the given index is part of
  2. Number of rows: size of that block

This would be very useful for updating only one block in a large document rather than the whole document.

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

No branches or pull requests

1 participant