clean pleroma account's fields url, fix #200
This commit is contained in:
parent
6a2ec8bd23
commit
5731962603
|
@ -157,7 +157,7 @@ export class UserProfileComponent implements OnInit {
|
|||
this.isLoading = false;
|
||||
this.statusLoading = true;
|
||||
|
||||
this.displayedAccount = account;
|
||||
this.displayedAccount = this.fixPleromaFieldsUrl(account);
|
||||
this.hasNote = account && account.note && account.note !== '<p></p>';
|
||||
if (this.hasNote) {
|
||||
this.note = this.emojiConverter.applyEmojis(account.emojis, account.note, EmojiTypeEnum.medium);
|
||||
|
@ -178,6 +178,18 @@ export class UserProfileComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
private fixPleromaFieldsUrl(acc: Account): Account {
|
||||
if(acc.fields){
|
||||
acc.fields.forEach(f => {
|
||||
if(f.value.includes('<a href="') && !f.value.includes('target="_blank"')){
|
||||
f.value = f.value.replace('<a href="', '<a target="_blank" href="');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return acc;
|
||||
}
|
||||
|
||||
private getPinnedStatuses(userAccount: AccountInfo, account: Account): Promise<void> {
|
||||
return this.mastodonService.getAccountStatuses(userAccount, account.id, false, true, false, null, null, 20)
|
||||
.then((statuses: Status[]) => {
|
||||
|
|
Loading…
Reference in New Issue