fix formatting bug. fixes #319 closes #320

This commit is contained in:
Kevin Jahns
2021-08-02 16:43:25 +02:00
parent 89b4320a8e
commit 4707fc46ac
2 changed files with 19 additions and 3 deletions

View File

@@ -168,3 +168,18 @@ export const testClone = tc => {
t.assert(cloneYxml.length === 3)
t.compare(cloneYxml.toJSON(), yxml.toJSON())
}
/**
* @param {t.TestCase} tc
*/
export const testFormattingBug = tc => {
const ydoc = new Y.Doc()
const yxml = /** @type {Y.XmlText} */ (ydoc.get('', Y.XmlText))
const delta = [
{ insert: 'A', attributes: { em: {}, strong: {} } },
{ insert: 'B', attributes: { em: {} } },
{ insert: 'C', attributes: { em: {}, strong: {} } }
]
yxml.applyDelta(delta)
t.compare(yxml.toDelta(), delta)
}