From 2daae70ada27f3d9803a7e3de2c5c467ee96b71a Mon Sep 17 00:00:00 2001 From: Marie-Laure Thuret Date: Tue, 25 Jul 2017 11:42:56 +0200 Subject: [PATCH] fix(highlight): wrong parsing between client and server (#183) BREAKING CHANGE: We remove the timestamp present in our highlight preTag and postTag. If you were using regex to parse the highlighting results then you'll need to adapt it as now it's only "ais-highlight". --- .../src/core/createInstantSearchServer.js | 3 ++- packages/react-instantsearch/src/core/highlightTags.js | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react-instantsearch/src/core/createInstantSearchServer.js b/packages/react-instantsearch/src/core/createInstantSearchServer.js index 1f23fd9acf..0f66fc3168 100644 --- a/packages/react-instantsearch/src/core/createInstantSearchServer.js +++ b/packages/react-instantsearch/src/core/createInstantSearchServer.js @@ -9,6 +9,7 @@ import ReactDom from 'react-dom/server'; import { getIndex, hasMultipleIndex } from './indexUtils'; import { isEmpty } from 'lodash'; import cis from './createInstantSearch'; +import highlightTags from './highlightTags.js'; const createInstantSearch = function(algoliasearch) { const InstantSearch = cis(algoliasearch, { @@ -48,7 +49,7 @@ const createInstantSearch = function(algoliasearch) { searchParameter.props, searchParameter.searchState ), - new SearchParameters({ index: indexName }) + new SearchParameters({ index: indexName, ...highlightTags }) ); const mergedSearchParameters = searchParameters diff --git a/packages/react-instantsearch/src/core/highlightTags.js b/packages/react-instantsearch/src/core/highlightTags.js index 287e3dbf3a..9916731fc5 100644 --- a/packages/react-instantsearch/src/core/highlightTags.js +++ b/packages/react-instantsearch/src/core/highlightTags.js @@ -1,6 +1,4 @@ -const timestamp = Date.now().toString(); - export default { - highlightPreTag: ``, - highlightPostTag: ``, + highlightPreTag: ``, + highlightPostTag: ``, };