add the inline stylesheet option when recording

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent e1f023ae0c
commit f312ecbadc
5 changed files with 15 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
checkoutEveryNth,
blockClass = 'rr-block',
ignoreClass = 'rr-ignore',
inlineStylesheet = true,
} = options;
// runtime checks for user options
if (!emit) {
@@ -62,7 +63,7 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
}),
isCheckout,
);
const [node, idNodeMap] = snapshot(document, blockClass);
const [node, idNodeMap] = snapshot(document, blockClass, inlineStylesheet);
if (!node) {
return console.warn('Failed to snapshot the document');
}
@@ -160,6 +161,7 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
),
blockClass,
ignoreClass,
inlineStylesheet,
}),
);
};