aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-11-14 00:47:20 +0200
committerHenry Jameson <me@hjkos.com>2019-11-14 00:47:20 +0200
commit897131572f62c36277e06e464f328f37cf6acad2 (patch)
treebc95764ee5738b2eb0ab9c2323893b3b09e1fe90 /src/components/status/status.js
parent692ee0e95a852b1f803b7ae92d65cbf4f3ce3445 (diff)
Made it optional
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 416aa36a..dd0ce3ab 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -259,26 +259,30 @@ const Status = {
postBodyHtml () {
const html = this.status.statusnet_html
- try {
- if (html.includes('&gt;')) {
- // This checks if post has '>' at the beginning, excluding mentions so that @mention >impying works
- return processHtml(html, (string) => {
- if (string.includes('&gt;') &&
- string
- .replace(/<[^>]+?>/gi, '') // remove all tags
- .replace(/@\w+/gi, '') // remove mentions (even failed ones)
- .trim()
- .startsWith('&gt;')) {
- return `<span class='greentext'>${string}</span>`
- } else {
- return string
- }
- })
- } else {
+ if (this.mergedConfig.greentext) {
+ try {
+ if (html.includes('&gt;')) {
+ // This checks if post has '>' at the beginning, excluding mentions so that @mention >impying works
+ return processHtml(html, (string) => {
+ if (string.includes('&gt;') &&
+ string
+ .replace(/<[^>]+?>/gi, '') // remove all tags
+ .replace(/@\w+/gi, '') // remove mentions (even failed ones)
+ .trim()
+ .startsWith('&gt;')) {
+ return `<span class='greentext'>${string}</span>`
+ } else {
+ return string
+ }
+ })
+ } else {
+ return html
+ }
+ } catch (e) {
+ console.err('Failed to process status html', e)
return html
}
- } catch (e) {
- console.err('Failed to process status html', e)
+ } else {
return html
}
},