|
@@ -15,7 +15,13 @@ export type RetrieveSearchCandidatesOptions = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
function stripHtmlTags(html: string): string {
|
|
function stripHtmlTags(html: string): string {
|
|
|
- return html.replace(/<[^>]*>/g, '');
|
|
|
|
|
|
|
+ let previous: string;
|
|
|
|
|
+ let result = html;
|
|
|
|
|
+ do {
|
|
|
|
|
+ previous = result;
|
|
|
|
|
+ result = result.replace(/<[^>]*>/g, '');
|
|
|
|
|
+ } while (result !== previous);
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function extractSnippet(item: SearchResultItem): string {
|
|
function extractSnippet(item: SearchResultItem): string {
|