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:
@@ -575,7 +575,7 @@ function serializeTextNode(
|
||||
needMaskingText(n, maskTextClass, maskTextSelector)
|
||||
) {
|
||||
textContent = maskTextFn
|
||||
? maskTextFn(textContent)
|
||||
? maskTextFn(textContent, n.parentElement)
|
||||
: textContent.replace(/[\S]/g, '*');
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ export type DataURLOptions = Partial<{
|
||||
quality: number;
|
||||
}>;
|
||||
|
||||
export type MaskTextFn = (text: string) => string;
|
||||
export type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
||||
export type MaskInputFn = (text: string, element: HTMLElement) => string;
|
||||
|
||||
export type KeepIframeSrcFn = (src: string) => boolean;
|
||||
|
||||
Reference in New Issue
Block a user