fix(ui): codeql-1693 Incomplete multi-character sanitization fix (#23738)

This commit is contained in:
Ushran Gouhar 2025-10-10 15:31:11 +05:30 committed by GitHub
parent cf75d76bc8
commit dfda6323c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@
* limitations under the License.
*/
import { expect, Page } from '@playwright/test';
import { JSDOM } from 'jsdom';
import { isEmpty, lowerCase } from 'lodash';
import {
BIG_ENTITY_DELETE_TIMEOUT,
@ -1876,7 +1877,9 @@ export const getTextFromHtmlString = (description?: string): string => {
return '';
}
return description.replace(/<[^>]*>/g, '').trim();
const dom = new JSDOM(description);
return dom.window.document.body.textContent?.trim() ?? '';
};
export const getFirstRowColumnLink = (page: Page) => {