We can diff changed blocks by running commonmark with this parameter .includeSourceSpans(IncludeSourceSpans.BLOCKS) and then finding the first and the last unchanged fragment of a string. Then run commonmark on items in between and replace these blocks in the Document's children list.
We can diff changed blocks by running commonmark with this parameter
.includeSourceSpans(IncludeSourceSpans.BLOCKS)
and then finding the first and the last unchanged fragment of a string. Then run commonmark on items in between and replace these blocks in the Document's children list.