(ed: Editor, content: string, hasMentions: boolean)
| 134 | }) |
| 135 | |
| 136 | function loadContent(ed: Editor, content: string, hasMentions: boolean): void { |
| 137 | if (isHtmlContent(content)) { |
| 138 | ed.commands.setContent(content, { emitUpdate: false, contentType: 'html' }) |
| 139 | } else { |
| 140 | ed.commands.setContent(escapeXmlTags(content), { emitUpdate: false, contentType: 'markdown' }) |
| 141 | ed.commands.setContent(restoreTextMentions(ed.getJSON() as JsonNode, hasMentions)[0], { emitUpdate: false }) |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * A TipTap-based text input with `{{ variable }}` mention support. |
no test coverage detected