mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Rendering large text. #705
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @p6laris on GitHub (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 commented on GitHub (Nov 24, 2024):
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?