diff --git a/package.json b/package.json
index 62d5ac57..f311909c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sengi",
- "version": "1.0.2",
+ "version": "1.0.3",
"license": "AGPL-3.0-or-later",
"main": "main-electron.js",
"description": "A multi-account desktop client for Mastodon and Pleroma",
diff --git a/src/app/components/stream/status/status.component.scss b/src/app/components/stream/status/status.component.scss
index 0d61305c..d55cd5e7 100644
--- a/src/app/components/stream/status/status.component.scss
+++ b/src/app/components/stream/status/status.component.scss
@@ -150,7 +150,8 @@
min-height: 80px;
display: block;
margin: 0 10px 0 $avatar-column-space;
- padding: 3px 5px 12px 5px;
+ padding: 3px 5px 14px 5px;
+ overflow-wrap: break-word;
text-decoration: none;
text-align: center;
diff --git a/src/app/components/stream/status/status.component.ts b/src/app/components/stream/status/status.component.ts
index 346520b0..1c1bbb7f 100644
--- a/src/app/components/stream/status/status.component.ts
+++ b/src/app/components/stream/status/status.component.ts
@@ -100,54 +100,20 @@ export class StatusComponent implements OnInit {
ngOnInit() {
}
-
- // private checkContentWarning(status: Status) {
- // let cwPolicy = this.toolsService.getSettings().contentWarningPolicy;
-
- // let splittedContent = [];
- // if ((cwPolicy.policy === ContentWarningPolicyEnum.HideAll && cwPolicy.addCwOnContent.length > 0)
- // || (cwPolicy.policy === ContentWarningPolicyEnum.AddOnAllContent && cwPolicy.removeCwOnContent.length > 0)
- // || (cwPolicy.hideCompletlyContent && cwPolicy.hideCompletlyContent.length > 0)) {
- // let parser = new DOMParser();
- // let dom = parser.parseFromString((status.content + ' ' + status.spoiler_text).replace("
", " ").replace("
", " ").replace(/\n/g, ' '), 'text/html')
- // let contentToParse = dom.body.textContent;
- // splittedContent = contentToParse.toLowerCase().split(' ');
- // }
-
- // if (cwPolicy.policy === ContentWarningPolicyEnum.None && (status.sensitive || status.spoiler_text)) {
- // this.setContentWarning(status);
- // } else if (cwPolicy.policy === ContentWarningPolicyEnum.HideAll) {
- // let detected = cwPolicy.addCwOnContent.filter(x => splittedContent.find(y => y == x || y == `#${x}`));
- // if (!detected || detected.length === 0) {
- // this.status.sensitive = false;
- // } else {
- // if (!status.spoiler_text) {
- // status.spoiler_text = detected.join(' ');
- // }
- // this.setContentWarning(status);
- // }
- // } else if (cwPolicy.policy === ContentWarningPolicyEnum.AddOnAllContent) {
- // let detected = cwPolicy.removeCwOnContent.filter(x => splittedContent.find(y => y == x || y == `#${x}`));
-
- // if (detected && detected.length > 0) {
- // this.status.sensitive = false;
- // } else {
- // this.setContentWarning(status);
- // }
- // }
-
- // if (cwPolicy.hideCompletlyContent && cwPolicy.hideCompletlyContent.length > 0) {
- // let detected = cwPolicy.hideCompletlyContent.filter(x => splittedContent.find(y => y == x || y == `#${x}`));
- // if (detected && detected.length > 0) {
- // this.hideStatus = true;
- // }
- // }
- // }
-
+
private setContentWarning(status: StatusWrapper) {
this.hideStatus = status.hide;
this.isContentWarned = status.applyCw;
- this.contentWarningText = this.emojiConverter.applyEmojis(this.displayedStatus.emojis, status.status.spoiler_text, EmojiTypeEnum.medium);
+
+ let spoiler = this.htmlEncode(status.status.spoiler_text);
+ this.contentWarningText = this.emojiConverter.applyEmojis(this.displayedStatus.emojis, spoiler, EmojiTypeEnum.medium);
+ }
+
+ private htmlEncode(str: string): string {
+ var encodedStr = str.replace(/[\u00A0-\u9999<>\&]/gim, function (i) {
+ return '' + i.charCodeAt(0) + ';';
+ });
+ return encodedStr;
}
removeContentWarning(): boolean {