|
|
@ -259,26 +259,30 @@ const Status = {
|
|
|
|
postBodyHtml () {
|
|
|
|
postBodyHtml () {
|
|
|
|
const html = this.status.statusnet_html
|
|
|
|
const html = this.status.statusnet_html
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
if (this.mergedConfig.greentext) {
|
|
|
|
if (html.includes('>')) {
|
|
|
|
try {
|
|
|
|
// This checks if post has '>' at the beginning, excluding mentions so that @mention >impying works
|
|
|
|
if (html.includes('>')) {
|
|
|
|
return processHtml(html, (string) => {
|
|
|
|
// This checks if post has '>' at the beginning, excluding mentions so that @mention >impying works
|
|
|
|
if (string.includes('>') &&
|
|
|
|
return processHtml(html, (string) => {
|
|
|
|
string
|
|
|
|
if (string.includes('>') &&
|
|
|
|
.replace(/<[^>]+?>/gi, '') // remove all tags
|
|
|
|
string
|
|
|
|
.replace(/@\w+/gi, '') // remove mentions (even failed ones)
|
|
|
|
.replace(/<[^>]+?>/gi, '') // remove all tags
|
|
|
|
.trim()
|
|
|
|
.replace(/@\w+/gi, '') // remove mentions (even failed ones)
|
|
|
|
.startsWith('>')) {
|
|
|
|
.trim()
|
|
|
|
return `<span class='greentext'>${string}</span>`
|
|
|
|
.startsWith('>')) {
|
|
|
|
} else {
|
|
|
|
return `<span class='greentext'>${string}</span>`
|
|
|
|
return string
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
return string
|
|
|
|
})
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return html
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
console.err('Failed to process status html', e)
|
|
|
|
return html
|
|
|
|
return html
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} else {
|
|
|
|
console.err('Failed to process status html', e)
|
|
|
|
|
|
|
|
return html
|
|
|
|
return html
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|