${escapeHtml(content)}`\n\n\tconst editor = isRichEditor ? createRichEditor() : createPlainEditor()\n\teditor.commands.setContent(html)\n\n\tconst json = editor.getJSON()\n\n\tconst node = Node.fromJSON(editor.schema, json)\n\tconst getBaseDoc = (node) => {\n\t\tconst baseDoc = new Doc()\n\t\t// In order to make the initial document state idempotent, we need to reset the clientID\n\t\t// While this is not recommended, we cannot avoid it here as we lack another mechanism\n\t\t// to generate the initial state on the server side\n\t\t// The only other option to avoid this could be to generate the initial state once and push\n\t\t// it to the server immediately, however this would require read only sessions to be able\n\t\t// to still push a state\n\t\tbaseDoc.clientID = 0\n\t\tconst type = /** @type {XmlFragment} */ (baseDoc.get('default', XmlFragment))\n\t\tif (!type.doc) {\n\t\t\t// This should not happen but is aligned with the upstream implementation\n\t\t\t// https://github.com/yjs/y-prosemirror/blob/8db24263770c2baaccb08e08ea9ef92dbcf8a9da/src/lib.js#L209\n\t\t\treturn baseDoc\n\t\t}\n\n\t\tprosemirrorToYXmlFragment(node, type)\n\t\treturn baseDoc\n\t}\n\n\tconst baseUpdate = encodeStateAsUpdate(getBaseDoc(node))\n\tapplyUpdate(ydoc, baseUpdate)\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { Node } from '@nextcloud/files'\nimport {\n\tdavGetClient,\n\tdavGetDefaultPropfind,\n\tdavResultToNode,\n} from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nexport const client = davGetClient()\n\nexport const fetchNode = async (node: Node): Promise\n\t\t\t{{ card.message }}\n\t\t\t{{\n\t\t\t\tcard.actionLabel\n\t\t\t}}\n\t\t
\n\t\n\t\t\t\t{{ t('text', 'Last saved') }}: {{ lastSavedString }}\n\t\t\t
\n\t\t