Skip to content

Commit

Permalink
Fix inner-text parsing by switching to textContent from innerText
Browse files Browse the repository at this point in the history
  • Loading branch information
drewvolz committed Oct 30, 2021
1 parent fdcde52 commit dbd4552
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/html-lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {parseDocument} from 'htmlparser2'

import {innerText} from 'domutils'
export {innerText}
import {textContent} from 'domutils'
export {textContent}

import type {Node, Document} from 'domhandler'

Expand All @@ -19,7 +19,7 @@ export function parseHtml(string: string): Document {
}

export function innerTextWithSpaces(elem: Node | Node[]): string {
return innerText(elem).split(/\s+/u).join(' ').trim()
return textContent(elem).split(/\s+/u).join(' ').trim()
}

export function removeHtmlWithRegex(str: string): string {
Expand Down

0 comments on commit dbd4552

Please # to comment.