]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / client / src / app / +video-channels / video-channel-about / video-channel-about.component.ts
index dc0893962056fdd0023146ddce34a8e5e399a230..895b190648e28c31766e2e5a22973cbdb6b7505a 100644 (file)
@@ -1,9 +1,9 @@
 import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ActivatedRoute } from '@angular/router'
 import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
 import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
 import { I18n } from '@ngx-translate/i18n-polyfill'
 import { Subscription } from 'rxjs'
+import { MarkdownService } from '@app/shared/renderer'
 
 @Component({
   selector: 'my-video-channel-about',
@@ -12,19 +12,26 @@ import { Subscription } from 'rxjs'
 })
 export class VideoChannelAboutComponent implements OnInit, OnDestroy {
   videoChannel: VideoChannel
+  descriptionHTML = ''
+  supportHTML = ''
 
   private videoChannelSub: Subscription
 
   constructor (
-    private route: ActivatedRoute,
     private i18n: I18n,
-    private videoChannelService: VideoChannelService
+    private videoChannelService: VideoChannelService,
+    private markdownService: MarkdownService
   ) { }
 
   ngOnInit () {
     // Parent get the video channel for us
     this.videoChannelSub = this.videoChannelService.videoChannelLoaded
-      .subscribe(videoChannel => this.videoChannel = videoChannel)
+      .subscribe(videoChannel => {
+        this.videoChannel = videoChannel
+
+        this.descriptionHTML = this.markdownService.textMarkdownToHTML(this.videoChannel.description)
+        this.supportHTML = this.markdownService.enhancedMarkdownToHTML(this.videoChannel.support)
+      })
   }
 
   ngOnDestroy () {
@@ -32,7 +39,7 @@ export class VideoChannelAboutComponent implements OnInit, OnDestroy {
   }
 
   getVideoChannelDescription () {
-    if (this.videoChannel.description) return this.videoChannel.description
+    if (this.descriptionHTML) return this.descriptionHTML
 
     return this.i18n('No description')
   }