From 6457f9ff6232f8bfcf86b712c71b61fc9f9b93df Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] fix #14 fix innerText cap issue --- src/snapshot.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/snapshot.ts b/src/snapshot.ts index 0ffa96d8..0cd79471 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -158,7 +158,11 @@ function serializeNode( tagName === 'style' && (n as HTMLStyleElement).sheet && // TODO: Currently we only try to get dynamic stylesheet when it is an empty style element - !(n as HTMLElement).innerText.trim().length + !( + (n as HTMLElement).innerText || + (n as HTMLElement).textContent || + '' + ).trim().length ) { const cssText = getCssRulesString((n as HTMLStyleElement) .sheet as CSSStyleSheet);