Skip to content

Rendering large text. #825

Open
Open

Description

@p6laris

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.

Activity

  1. xoofx commented on Nov 24, 2024

    @xoofx
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions