This module is used to speed up parsing-rendering by comparing the old and new lists of paragraphs, noting the changes, then parsing and rendering the changed paragraphs.
An empty EditRecord -- like the integer 0 in another context.
An empty EditRecord -- like the integer 0 in another context. For
renderers with Html a as target.
An EditRecord is considered to be empyt if its list of parapgraphs and its list of rendered paraagrahs is empty
createRecord: Create an edit record by (1) breaking the text in to pargraphs, (2) applying the transformer to each string in the resulting list of strings.
Let u and v be two lists of strings. Write them as u = axb, v = ayb, where a is the greatest common prefix and b is the greatest common suffix. Return DiffRecord a b x y
The prefixer is used to generate unique id's "p.1", "p.2", etc. for each paragraph.
The update function takes an EditRecord and a string, the "text",
breaks the text into a list of logical paragraphs, diffs it with the list
of paragraphs held by the EditRecord, uses differentialRender to
render the changed paragraphs while copying the unchanged rendered paragraphsto
prodduce an updated list of rendered paragraphs. The 'differentialRender'
accomplishes this using the transformer. The seed is used to produces
a differential idList. This last step is perhaps unnecessary. To investigate.
(This was part of an optimization scheme.)
Update the renderedList by applying the transformer onlly to the changed source elments.
An EditRecord records a list of (logical) newParagraphs correspoing to the text to be rendered as well as corresponding list of rendered parapgraphs. We need to reveiw this strucure.