fix #474 - formatting bug
This commit is contained in:
parent
e9189365ee
commit
1c999b250e
@ -382,12 +382,17 @@ const cleanupFormattingGap = (transaction, start, curr, startAttributes, currAtt
|
||||
switch (content.constructor) {
|
||||
case ContentFormat: {
|
||||
const { key, value } = /** @type {ContentFormat} */ (content)
|
||||
if ((endAttributes.get(key) || null) !== value || (startAttributes.get(key) || null) === value) {
|
||||
const startAttrValue = startAttributes.get(key) || null
|
||||
if ((endAttributes.get(key) || null) !== value || startAttrValue === value) {
|
||||
// Either this format is overwritten or it is not necessary because the attribute already existed.
|
||||
start.delete(transaction)
|
||||
cleanups++
|
||||
if (!reachedEndOfCurr && (currAttributes.get(key) || null) === value && (startAttributes.get(key) || null) !== value) {
|
||||
currAttributes.delete(key)
|
||||
if (startAttrValue === null) {
|
||||
currAttributes.delete(key)
|
||||
} else {
|
||||
currAttributes.set(key, startAttrValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
|
@ -206,7 +206,6 @@ export const testDeltaBug = _tc => {
|
||||
}
|
||||
]
|
||||
ytext.applyDelta(addingSpace)
|
||||
debugger
|
||||
const addingList = [
|
||||
{
|
||||
retain: 12
|
||||
@ -411,7 +410,6 @@ export const testDeltaBug = _tc => {
|
||||
}
|
||||
]
|
||||
t.compare(result, expectedResult)
|
||||
debugger
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user