1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Files
tooot/src/helpers/removeHTML.ts
xmflsct 24ccee8afa Fixed #525
HTML is removed. In this way, if a URL is changed, it can be highlighted as well
2022-12-11 16:52:34 +01:00

19 lines
318 B
TypeScript

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