1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
HTML is removed. In this way, if a URL is changed, it can be highlighted as well
This commit is contained in:
xmflsct
2022-12-11 16:52:34 +01:00
parent 306bc45e33
commit 24ccee8afa
7 changed files with 104 additions and 52 deletions

18
src/helpers/removeHTML.ts Normal file
View File

@ -0,0 +1,18 @@
import htmlparser2 from 'htmlparser2-without-node-native'
const removeHTML = (text: string): string => {
let raw: string = ''
const parser = new htmlparser2.Parser({
ontext: (text: string) => {
raw = raw + text
}
})
parser.write(text)
parser.end()
return raw
}
export default removeHTML