Новости для главной
This commit is contained in:
1 parent
e0bf00ee9d
commit
be136d0f4f
1 file changed
+5
-6
@@ -149,12 +149,11 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
const limitText=(text)=> {
|
const limitText=(text)=> {
|
||||||
|
let parser = new DOMParser().parseFromString(text, "text/html");
|
||||||
text = text.replaceAll('src="/media/uploads', `src="${baseURL}media/uploads`)
|
let doc = parser.body.textContent || ""
|
||||||
const t = text.split(' ').slice(0, 25)
|
doc = doc.replaceAll('src="/media/uploads', `src="${baseURL}media/uploads`)
|
||||||
|
const t = doc.split(' ').slice(0, 25)
|
||||||
|
return `${doc.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}`
|
||||||
return `${text.split(' ').slice(0, 25).join(' ')} ${t.length<25?'':'...'}`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const splitname = (name) => {
|
const splitname = (name) => {
|
||||||
|
|||||||
Reference in new issue
Block a user