This commit is contained in:
Mihajlo Medjedovic committed 2024-06-05 15:53:46 +02:00
commit fd510b88c4
270 files changed
+27578

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
const extractContent = (s: string): string => {
if (typeof document !== `undefined`) {
const span = document.createElement('span')
span.innerHTML = s
return span.textContent || span.innerText
}
return s
}
const getDescription = (content: string): string => {
return extractContent(content).substr(0, 100) + '...'
}
export default getDescription