aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/frontend/src')
-rw-r--r--plugins/base/frontend/src/main/components/search/searchResultRow.tsx20
-rw-r--r--plugins/base/frontend/src/main/types/@jetbrains/index.d.ts4
2 files changed, 18 insertions, 6 deletions
diff --git a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx
index 81e1bad9..83dd2bcb 100644
--- a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx
+++ b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx
@@ -1,6 +1,14 @@
import React from "react";
import {OptionWithSearchResult, SearchProps, SearchRank} from "./types";
-import Markdown from '@jetbrains/ring-ui/components/markdown/markdown';
+import _ from "lodash";
+
+type HighlighterProps = {
+ label: string
+}
+
+const Highlighter: React.FC<HighlighterProps> = ({label}: HighlighterProps) => {
+ return <strong>{label}</strong>
+}
export const SearchResultRow: React.FC<SearchProps> = ({searchResult}: SearchProps) => {
const signatureFromSearchResult = (searchResult: OptionWithSearchResult): string => {
@@ -10,9 +18,17 @@ export const SearchResultRow: React.FC<SearchProps> = ({searchResult}: SearchPro
return searchResult.highlight
}
+ /*
+ This is a work-around for an issue: https://youtrack.jetbrains.com/issue/RG-2108
+ */
+ const out = _.chunk(signatureFromSearchResult(searchResult).split('**'), 2).flatMap(([txt, label]) => [
+ txt,
+ label ? <Highlighter label={label}></Highlighter> : null,
+ ]);
+
return (
<div className="template-wrapper">
- <span><Markdown source={signatureFromSearchResult(searchResult)}/></span>
+ <span>{out}</span>
<span className="template-description">{searchResult.description}</span>
</div>
)
diff --git a/plugins/base/frontend/src/main/types/@jetbrains/index.d.ts b/plugins/base/frontend/src/main/types/@jetbrains/index.d.ts
index ceee5179..3d209657 100644
--- a/plugins/base/frontend/src/main/types/@jetbrains/index.d.ts
+++ b/plugins/base/frontend/src/main/types/@jetbrains/index.d.ts
@@ -2,7 +2,3 @@ declare module '@jetbrains/ring-ui' {
export const Select: any;
export const List: any;
}
-
-declare module '@jetbrains/ring-ui/components/markdown/markdown' {
- export const Markdown: any
-}