remove html tags from meta tags
This commit is contained in:
7
src/lib/js/stripHtmlTags.ts
Normal file
7
src/lib/js/stripHtmlTags.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Function to strip HTML tags from a string
|
||||
function stripHtmlTags(input) {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(input, 'text/html');
|
||||
const textContent = doc.body.textContent || "";
|
||||
return textContent;
|
||||
}
|
Reference in New Issue
Block a user