| 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(); |