@docsearch/react
Advanced tools
Comparing version 3.0.0-alpha.35 to 3.0.0-alpha.36
@@ -204,3 +204,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var sources = groupBy(hits, function (hit) { | ||
return removeHighlightTags(hit.hierarchy.lvl0); | ||
return removeHighlightTags(hit); | ||
}); // We store the `lvl0`s to display them as search suggestions | ||
@@ -207,0 +207,0 @@ // in the “no results“ screen. |
@@ -15,3 +15,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var title = removeHighlightTags(collection.items[0]._highlightResult.hierarchy.lvl0.value); | ||
var title = removeHighlightTags(collection.items[0]); | ||
return /*#__PURE__*/React.createElement(Results, _extends({}, props, { | ||
@@ -18,0 +18,0 @@ key: index, |
@@ -1,1 +0,2 @@ | ||
export declare function removeHighlightTags(value: string): string; | ||
import { DocSearchHit, InternalDocSearchHit } from './../types'; | ||
export declare function removeHighlightTags(hit: DocSearchHit | InternalDocSearchHit): string; |
var regexHighlightTags = /(<mark>|<\/mark>)/g; | ||
var regexHasHighlightTags = RegExp(regexHighlightTags.source); | ||
export function removeHighlightTags(value) { | ||
export function removeHighlightTags(hit) { | ||
if (!hit.__docsearch_parent && !hit._highlightResult) { | ||
return hit.hierarchy.lvl0; | ||
} | ||
var _ref = hit._highlightResult ? hit._highlightResult.hierarchy.lvl0 : hit.__docsearch_parent._highlightResult.hierarchy.lvl0, | ||
value = _ref.value; | ||
return value && regexHasHighlightTags.test(value) ? value.replace(regexHighlightTags, '') : value; | ||
} |
@@ -1,1 +0,1 @@ | ||
export declare const version = "3.0.0-alpha.35"; | ||
export declare const version = "3.0.0-alpha.36"; |
@@ -1,1 +0,1 @@ | ||
export var version = '3.0.0-alpha.35'; | ||
export var version = '3.0.0-alpha.36'; |
{ | ||
"name": "@docsearch/react", | ||
"description": "React package for DocSearch, the best search experience for docs.", | ||
"version": "3.0.0-alpha.35", | ||
"version": "3.0.0-alpha.36", | ||
"license": "MIT", | ||
@@ -39,3 +39,3 @@ "homepage": "https://docsearch.algolia.com", | ||
"@algolia/autocomplete-preset-algolia": "1.0.0-alpha.44", | ||
"@docsearch/css": "3.0.0-alpha.35", | ||
"@docsearch/css": "3.0.0-alpha.36", | ||
"algoliasearch": "^4.0.0" | ||
@@ -42,0 +42,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374847
1944
+ Added@docsearch/css@3.0.0-alpha.36(transitive)
- Removed@docsearch/css@3.0.0-alpha.35(transitive)