Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix Sky Highlight not recognizing backslash #1513

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/demos/flyout/flyout-demo.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#customTemplate>
<button
type="button"
class="sky-btn sky-btn-primary"
class="sky-btn sky-btn-link"
(click)="openRecord(row)">
View record
</button>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/text-highlight/text-highlight.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export class SkyTextHighlightDirective

private static getRegexMatch(node: HTMLElement, searchText: string): RegExpExecArray {
const text = node.nodeValue;
const searchRegex = new RegExp(searchText, 'gi');

const newSearchText = searchText.replace(/\\/g, '\\\\');
const searchRegex = new RegExp(newSearchText, 'gi');
return searchRegex.exec(text);
}

Expand Down