doupache commented on code in PR #153:
URL: https://github.com/apache/yunikorn-web/pull/153#discussion_r1407880711


##########
src/app/components/nodes-view/highlighttable-search.pipe.ts:
##########
@@ -0,0 +1,13 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+  name: 'highlightSearch'
+})
+export class HighlightSearchPipe implements PipeTransform {
+
+  transform(value: string, search: string): string {
+    const valueStr = value + ''; // Ensure numeric values are converted to 
strings
+    return valueStr.replace(new RegExp('(?![^&;]+;)(?!<[^<>]*)(' + search + 
')(?![^<>]*>)(?![^&;]+;)', 'gi'), '<strong>$1</strong>');

Review Comment:
   Can we add some comment about the Regex , maybe some example? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to