From b84bd718c4bbe86eb7d08df7c9ddd68afcf00be2 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 30 Jul 2020 13:37:53 +0200 Subject: Remove unsafe html usage --- .../base/frontend/src/main/components/search/searchResultRow.tsx | 9 ++------- plugins/base/frontend/src/main/types/@jetbrains/index.d.ts | 4 ++++ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'plugins/base/frontend/src/main') 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 = ({searchResult}: SearchProps) => { const signatureFromSearchResult = (searchResult: OptionWithSearchResult): string => { @@ -9,15 +10,9 @@ export const SearchResultRow: React.FC = ({searchResult}: SearchPro return searchResult.highlight } - const renderHighlightMarkersAsHtml = (record: string): string => { - return record.replace(/\*\*(.*?)\*\*/g, '$1') - } - return (
- + {searchResult.description}
) 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 +} -- cgit