aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-playlist
diff options
context:
space:
mode:
authorPoslovitch <poslovitch@bentobox.world>2021-10-23 21:57:59 +0000
committerChocobozzz <chocobozzz@cpy.re>2021-10-26 08:48:17 +0200
commit9f3bf1432d9087348563783c85e6ddb43649e2db (patch)
treec4b94971c7ed1c1de93a433ddab165d196f4a719 /client/src/app/shared/shared-video-playlist
parent3c4d6c1d9cd942849352656a25fa2d6459da6445 (diff)
downloadPeerTube-9f3bf1432d9087348563783c85e6ddb43649e2db.tar.gz
PeerTube-9f3bf1432d9087348563783c85e6ddb43649e2db.tar.zst
PeerTube-9f3bf1432d9087348563783c85e6ddb43649e2db.zip
Added Markdown formatting in playlist descriptions
Implements https://github.com/Chocobozzz/PeerTube/issues/3627
Diffstat (limited to 'client/src/app/shared/shared-video-playlist')
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html2
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts11
2 files changed, 11 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html
index 95f11f030..3cccbe080 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html
@@ -32,6 +32,6 @@
32 <span i18n class="updated-at">Updated {{ playlist.updatedAt | myFromNow }}</span> 32 <span i18n class="updated-at">Updated {{ playlist.updatedAt | myFromNow }}</span>
33 </div> 33 </div>
34 34
35 <div *ngIf="displayDescription" class="video-info-description">{{ playlist.description }}</div> 35 <div *ngIf="displayDescription" class="video-info-description" [innerHTML]="playlistDescription"></div>
36 </div> 36 </div>
37</div> 37</div>
diff --git a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts
index c80ea2e6b..dd9fe0a5a 100644
--- a/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts
@@ -1,6 +1,7 @@
1import { LinkType } from 'src/types/link.type' 1import { LinkType } from 'src/types/link.type'
2import { Component, Input, OnInit } from '@angular/core' 2import { Component, Input, OnInit } from '@angular/core'
3import { VideoPlaylist } from './video-playlist.model' 3import { VideoPlaylist } from './video-playlist.model'
4import { MarkdownService } from '@app/core'
4 5
5@Component({ 6@Component({
6 selector: 'my-video-playlist-miniature', 7 selector: 'my-video-playlist-miniature',
@@ -22,9 +23,17 @@ export class VideoPlaylistMiniatureComponent implements OnInit {
22 routerLink: any 23 routerLink: any
23 playlistHref: string 24 playlistHref: string
24 playlistTarget: string 25 playlistTarget: string
26 playlistDescription: string
25 27
26 ngOnInit () { 28 constructor (
29 private markdownService: MarkdownService
30 ) {}
31
32 async ngOnInit () {
27 this.buildPlaylistUrl() 33 this.buildPlaylistUrl()
34 if (this.displayDescription) {
35 this.playlistDescription = await this.markdownService.textMarkdownToHTML(this.playlist.description)
36 }
28 } 37 }
29 38
30 buildPlaylistUrl () { 39 buildPlaylistUrl () {