From e5774870dff0e9c10cfa08a648276c07a24d4913 Mon Sep 17 00:00:00 2001 From: "noemi.kallweit" Date: Sun, 16 Aug 2026 10:41:05 +0200 Subject: [PATCH] refactor(keyword-highlighting): drop the HTML-string path left unused after rebase --- .../app/resolvers/utils/keyword-highlight.ts | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/webapp/src/app/resolvers/utils/keyword-highlight.ts b/webapp/src/app/resolvers/utils/keyword-highlight.ts index c48459d1..d0879a84 100644 --- a/webapp/src/app/resolvers/utils/keyword-highlight.ts +++ b/webapp/src/app/resolvers/utils/keyword-highlight.ts @@ -83,8 +83,6 @@ export function keywordTooltip( const WORD_CHAR = '[\\w\\u00C0-\\u024F]'; -export const KW_MARK_CLASS = 'kw-mark'; - export interface KeywordSegment { text: string; match: KeywordColor | null; @@ -143,29 +141,6 @@ export function splitByKeywords( return segments; } -export function highlightKeywords( - text: string, - keywordColors: readonly KeywordColor[], -): string { - return splitByKeywords(text, keywordColors) - .map(({ text: value, match }) => { - if (!match) { - return escapeHtml(value); - } - - const tooltip = escapeHtml( - keywordTooltip(match.keyword, match.topicNames), - ); - - return ( - `` + - `${escapeHtml(value)}` - ); - }) - .join(''); -} - export interface SnippetSegment { text: string; isSearchMatch: boolean; @@ -227,14 +202,6 @@ export function decodeHtml(text: string): string { .replace(/&/g, '&'); } -export function escapeHtml(text: string): string { - return text - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} - function escapeRegex(text: string): string { return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); }