Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit c2fd07f

Browse files
Łukasz SobekjasonLaster
authored andcommitted
Changes highlight from <strong> to <mark> (#5647)
* Changes highlight from strong to mark * Removes yellow background from mark
1 parent ee8375d commit c2fd07f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/QuickOpenModal.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
.result-item .title .highlight {
22
font-weight: bold;
3+
background-color: transparent;
34
}
45

56
.result-item .subtitle .highlight {
67
color: var(--grey-90);
78
font-weight: 500;
9+
background-color: transparent;
810
}
911

1012
.theme-dark .result-item .title .highlight,

src/components/QuickOpenModal.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,13 @@ export class QuickOpenModal extends Component<Props, State> {
320320

321321
/* eslint-disable react/no-danger */
322322
renderHighlight = (candidateString: string, query: string, name: string) => {
323-
const html = fuzzyAldrin.wrap(candidateString, query);
324-
323+
const options = {
324+
wrap: {
325+
tagOpen: '<mark class="highlight">',
326+
tagClose: "</mark>"
327+
}
328+
};
329+
const html = fuzzyAldrin.wrap(candidateString, query, options);
325330
return <div dangerouslySetInnerHTML={{ __html: html }} />;
326331
};
327332

0 commit comments

Comments
 (0)