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

Rendering large text. #825

Open
p6laris opened this issue Nov 19, 2024 · 1 comment
Open

Rendering large text. #825

p6laris opened this issue Nov 19, 2024 · 1 comment
Labels

Comments

@p6laris
Copy link

p6laris commented Nov 19, 2024

Hi there,

I’m working on a project where I need to render large Markdown documents into HTML using Markdig. The issue I’m running into is performance when re-rendering the entire document after every change. I’d like to optimize this process by only re-rendering the sections that have been modified or added.

I’m wondering if there’s a way to achieve this using or any suggestions?

Cheers.

@xoofx xoofx added the question label Nov 24, 2024
@xoofx
Copy link
Owner

xoofx commented Nov 24, 2024

I’m wondering if there’s a way to achieve this using or any suggestions?

It would require maintaining the previous document model in memory and performing your own diff, and removing the nodes that are the same and then re-render things... but yeah, it will be complicated. You will need to identify where previous blocks map to previous text in order to do a safe replacement. It's possible (e.g. you can hook into the HTML renderer to record the line + associated markdown block)

How large is your input document and how frequent do you have to re-render it?

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