aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/frontend/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/frontend/src/main')
-rw-r--r--plugins/base/frontend/src/main/components/search/searchResultRow.tsx9
-rw-r--r--plugins/base/frontend/src/main/types/@jetbrains/index.d.ts4
2 files changed, 6 insertions, 7 deletions
diff --git a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx
index 9ae19cb9..81e1bad9 100644
--- a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx
+++ b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx
@@ -1,5 +1,6 @@
import React from "react";
import {OptionWithSearchResult, SearchProps, SearchRank} from "./types";
+import Markdown from '@jetbrains/ring-ui/components/markdown/markdown';
export const SearchResultRow: React.FC<SearchProps> = ({searchResult}: SearchProps) => {
const signatureFromSearchResult = (searchResult: OptionWithSearchResult): string => {
@@ -9,15 +10,9 @@ export const SearchResultRow: React.FC<SearchProps> = ({searchResult}: SearchPro
return searchResult.highlight
}
- const renderHighlightMarkersAsHtml = (record: string): string => {
- return record.replace(/\*\*(.*?)\*\*/g, '<span class="phraseHighlight">$1</span>')
- }
-
return (
<div className="template-wrapper">
- <span dangerouslySetInnerHTML={
- {__html: renderHighlightMarkersAsHtml(signatureFromSearchResult(searchResult)) }
- }/>
+ <span><Markdown source={signatureFromSearchResult(searchResult)}/></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 3d209657..ceee5179 100644
--- a/plugins/base/frontend/src/main/types/@jetbrains/index.d.ts
+++ b/plugins/base/frontend/src/main/types/@jetbrains/index.d.ts
@@ -2,3 +2,7 @@ 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
+}