diff --git a/src/util.ts b/src/util.ts index 8136f0e..9d8e8c2 100644 --- a/src/util.ts +++ b/src/util.ts @@ -219,6 +219,10 @@ export const decodeHTMLEntities = (text: string) => { return decodeTextarea.textContent || ''; } +export const stripHTML = (text: string) => { + return documentRange.createContextualFragment(text.replace(brToSpaceRegex,' ')).textContent || ''; +} + export const clipboardSuccess = () => () => notify(useStore().state.messages.copyToClipboardSuccess); export const clipboardError = () => (e: Error) => {