fix: update types for cursor and toRemove
This commit is contained in:
@@ -404,12 +404,12 @@ export function EmailComposer({
|
|||||||
// Remove the existing signature range [startEl … endEl] inclusive, or
|
// Remove the existing signature range [startEl … endEl] inclusive, or
|
||||||
// from startEl to the next blockquote if no end marker is present.
|
// from startEl to the next blockquote if no end marker is present.
|
||||||
const removeUntil = endEl && endEl.parentNode === parent ? endEl : null;
|
const removeUntil = endEl && endEl.parentNode === parent ? endEl : null;
|
||||||
let cursor: ChildNode | null = startEl;
|
const toRemove: Node[] = [];
|
||||||
const toRemove: ChildNode[] = [];
|
let cursor: Node | null = startEl;
|
||||||
while (cursor) {
|
while (cursor) {
|
||||||
toRemove.push(cursor);
|
toRemove.push(cursor);
|
||||||
if (cursor === removeUntil) break;
|
if (cursor === removeUntil) break;
|
||||||
const next: ChildNode | null = cursor.nextSibling;
|
const next: Node | null = cursor.nextSibling;
|
||||||
if (!removeUntil && next && (next as Element).tagName === 'BLOCKQUOTE') break;
|
if (!removeUntil && next && (next as Element).tagName === 'BLOCKQUOTE') break;
|
||||||
cursor = next;
|
cursor = next;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user