This commit is contained in:
Mihajlo Medjedovic
2024-06-05 15:53:46 +02:00
commit fd510b88c4
270 changed files with 27578 additions and 0 deletions

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