Skip to content

@sqlrooms/ai-core / HighlightedChatSearchText

Function: HighlightedChatSearchText()

HighlightedChatSearchText(__namedParameters): Element

Renders text with search matches wrapped in <mark>. text must be the exact string this call reports as rendered for blockId: it both supplies the offsets are matched against and the characters that get sliced, so a caller showing a transformed or shortened string is searched by that string, not by whatever the block was originally registered with.

Parameters

ParameterType
__namedParameters{ text: string; blockId: string; }
__namedParameters.textstring
__namedParameters.blockIdstring

Returns

Element