mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
16 lines
410 B
JavaScript
16 lines
410 B
JavaScript
export default {
|
|
methods: {
|
|
removeLinks(content) {
|
|
if (!content) return ''
|
|
// remove all links from excerpt to prevent issues with the surrounding link
|
|
let excerpt = content.replace(/<a.*>(.+)<\/a>/gim, '$1')
|
|
// do not display content that is only linebreaks
|
|
if (excerpt.replace(/<br>/gim, '').trim() === '') {
|
|
excerpt = ''
|
|
}
|
|
|
|
return excerpt
|
|
}
|
|
}
|
|
}
|