feat(editor): Node IO filter (#7503)

Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
Csaba Tuncsik
2023-11-15 16:19:48 +01:00
committed by GitHub
parent 93103c0b08
commit 18817651ec
18 changed files with 1331 additions and 85 deletions

View File

@@ -63,3 +63,9 @@ export const getBannerRowHeight = async (): Promise<number> => {
}, 0);
});
};
export const highlightText = (text: string, search = ''): string => {
const pattern = search.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
const regex = new RegExp(`(${pattern})`, 'gi');
return search ? text?.replace(regex, '<mark class="highlight">$1</mark>') : text;
};