aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-about/account-about.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-18 11:19:10 +0200
committerChocobozzz <me@florianbigard.com>2018-06-18 11:19:10 +0200
commit53055a1124cbc2eaeeeeef21b19b0b46e96f23c5 (patch)
treed761c9928d2568937fad9a2316f7ad2b8b223f07 /client/src/app/+accounts/account-about/account-about.component.ts
parent4d089429fe91ab7793b9b05010acb483d61345de (diff)
downloadPeerTube-53055a1124cbc2eaeeeeef21b19b0b46e96f23c5.tar.gz
PeerTube-53055a1124cbc2eaeeeeef21b19b0b46e96f23c5.tar.zst
PeerTube-53055a1124cbc2eaeeeeef21b19b0b46e96f23c5.zip
Handle markdown in account/video channel pages
Diffstat (limited to 'client/src/app/+accounts/account-about/account-about.component.ts')
-rw-r--r--client/src/app/+accounts/account-about/account-about.component.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/src/app/+accounts/account-about/account-about.component.ts b/client/src/app/+accounts/account-about/account-about.component.ts
index c0e793754..2acf67a59 100644
--- a/client/src/app/+accounts/account-about/account-about.component.ts
+++ b/client/src/app/+accounts/account-about/account-about.component.ts
@@ -4,6 +4,7 @@ import { Account } from '@app/shared/account/account.model'
4import { AccountService } from '@app/shared/account/account.service' 4import { AccountService } from '@app/shared/account/account.service'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { Subscription } from 'rxjs' 6import { Subscription } from 'rxjs'
7import { MarkdownService } from '@app/videos/shared'
7 8
8@Component({ 9@Component({
9 selector: 'my-account-about', 10 selector: 'my-account-about',
@@ -12,19 +13,24 @@ import { Subscription } from 'rxjs'
12}) 13})
13export class AccountAboutComponent implements OnInit, OnDestroy { 14export class AccountAboutComponent implements OnInit, OnDestroy {
14 account: Account 15 account: Account
16 descriptionHTML = ''
15 17
16 private accountSub: Subscription 18 private accountSub: Subscription
17 19
18 constructor ( 20 constructor (
19 private route: ActivatedRoute, 21 private route: ActivatedRoute,
20 private i18n: I18n, 22 private i18n: I18n,
21 private accountService: AccountService 23 private accountService: AccountService,
24 private markdownService: MarkdownService
22 ) { } 25 ) { }
23 26
24 ngOnInit () { 27 ngOnInit () {
25 // Parent get the account for us 28 // Parent get the account for us
26 this.accountSub = this.accountService.accountLoaded 29 this.accountSub = this.accountService.accountLoaded
27 .subscribe(account => this.account = account) 30 .subscribe(account => {
31 this.account = account
32 this.descriptionHTML = this.markdownService.textMarkdownToHTML(this.account.description)
33 })
28 } 34 }
29 35
30 ngOnDestroy () { 36 ngOnDestroy () {
@@ -32,7 +38,7 @@ export class AccountAboutComponent implements OnInit, OnDestroy {
32 } 38 }
33 39
34 getAccountDescription () { 40 getAccountDescription () {
35 if (this.account.description) return this.account.description 41 if (this.descriptionHTML) return this.descriptionHTML
36 42
37 return this.i18n('No description') 43 return this.i18n('No description')
38 } 44 }