diff options
3 files changed, 9 insertions, 10 deletions
diff --git a/plugins/base/frontend/package-lock.json b/plugins/base/frontend/package-lock.json index 4ccf72f2..0940acc8 100644 --- a/plugins/base/frontend/package-lock.json +++ b/plugins/base/frontend/package-lock.json @@ -7531,9 +7531,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, "lodash._reinterpolate": { "version": "3.0.0", 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 +} |