diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index 003d2f3e9b..701c268c4b 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -980,9 +980,10 @@ export function serializeNodeWithId( let { needsMask } = options; let { preserveWhiteSpace = true } = options; - if (!needsMask && - n.childNodes // we can avoid the check on leaf elements, as masking is applied to child text nodes only - ) { + if ( + !needsMask && + n.childNodes // we can avoid the check on leaf elements, as masking is applied to child text nodes only + ) { // perf: if needsMask = true, children won't also need to check const checkAncestors = needsMask === undefined; // if false, we've already checked ancestors needsMask = needMaskingText(