Skip to content

Commit 4b2203e

Browse files
authored
Set undefined highlight tags (#85)
1 parent 14f4b9e commit 4b2203e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/format.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ function replaceHighlightTags(value, highlightPreTag, highlightPostTag) {
55
// If the value of the attribute is a string,
66
// the highlight is applied by MeiliSearch (<em> tags)
77
// and we replace the <em> by the expected tag for InstantSearch
8+
highlightPreTag = highlightPreTag || '__ais-highlight__'
9+
highlightPostTag = highlightPostTag || '__/ais-highlight__'
810
if (isString(value)) {
911
newHighlightValue = value
1012
.replace(/<em>/g, highlightPreTag)

0 commit comments

Comments
 (0)