Extended text masking function to include relevant HTMLElement (#1310)

* Extends maskTextFn to pass the HTMLElement to the deciding function

---------

Authored-by: benjackwhite <benjackwhite@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
This commit is contained in:
Ben White
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 5e47fac5d0
commit db334d2405
8 changed files with 403 additions and 16 deletions

View File

@@ -575,7 +575,7 @@ function serializeTextNode(
needMaskingText(n, maskTextClass, maskTextSelector)
) {
textContent = maskTextFn
? maskTextFn(textContent)
? maskTextFn(textContent, n.parentElement)
: textContent.replace(/[\S]/g, '*');
}