MCPcopy
hub / github.com/marktext/marktext / patch

Method patch

packages/muya/src/inlineRenderer/index.ts:38–51  ·  view source on GitHub ↗
(block: Format, cursor?: ICursor, highlights: IHighlight[] = [])

Source from the content-addressed store, hash-verified

36 }
37
38 patch(block: Format, cursor?: ICursor, highlights: IHighlight[] = []) {
39 this.collectReferenceDefinitions();
40 const { domNode } = block;
41 if (block.isParent())
42 debug.error('Patch can only handle content block');
43
44 const tokens = this.tokenizer(block, highlights);
45 const html = this.renderer.output(
46 tokens,
47 block,
48 cursor && cursor.block === block ? cursor : {},
49 );
50 domNode!.innerHTML = html;
51 }
52
53 collectReferenceDefinitions() {
54 const state = this.muya.editor.jsonState.getState();

Callers 5

updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80
updateMethod · 0.80

Calls 4

tokenizerMethod · 0.95
isParentMethod · 0.80
outputMethod · 0.80

Tested by

no test coverage detected