We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 871ed96 commit c6fc5c2Copy full SHA for c6fc5c2
source/lib/html.js
@@ -31,6 +31,10 @@ export function getTrimmedTextWithSpaces(elem: Object | Object[]): string {
31
return getTextWithSpaces(elem).split(/\s+/).join(' ').trim()
32
}
33
34
+export function removeHtmlWithRegex(str: string): string {
35
+ return str.replace(/<[^>]*>|\s+/g, ' ')
36
+}
37
+
38
export function fastGetTrimmedText(str: string): string {
- return str.replace(/<[^>]*>|\s+/g, ' ').replace(/\s+/g, ' ').trim()
39
+ return removeHtmlWithRegex(str).replace(/\s+/g, ' ').trim()
40
0 commit comments