X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fcore%2Frenderer%2Fmarkdown.service.ts;h=36258ca9872f6f1a471b9ac83c8b57f5341a0148;hb=15a7eafb892441957ba7dd6fcbf556086fe5b2b3;hp=ca1bf4eb95416515bfeb1ebaec3e6191d3cbb5b2;hpb=1c5e49e75284100b7b1fc8b4e73c8ba53fe22e89;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/core/renderer/markdown.service.ts b/client/src/app/core/renderer/markdown.service.ts index ca1bf4eb9..36258ca98 100644 --- a/client/src/app/core/renderer/markdown.service.ts +++ b/client/src/app/core/renderer/markdown.service.ts @@ -1,6 +1,6 @@ import * as MarkdownIt from 'markdown-it' -import { buildVideoLink } from 'src/assets/player/utils' import { Injectable } from '@angular/core' +import { buildVideoLink, decorateVideoLink } from '@shared/core-utils' import { COMPLETE_RULES, ENHANCED_RULES, @@ -82,10 +82,14 @@ export class MarkdownService { return this.render({ name: 'customPageMarkdownIt', markdown, withEmoji: true, additionalAllowedTags }) } - processVideoTimestamps (html: string) { + processVideoTimestamps (videoShortUUID: string, html: string) { return html.replace(/((\d{1,2}):)?(\d{1,2}):(\d{1,2})/g, function (str, _, h, m, s) { const t = (3600 * +(h || 0)) + (60 * +(m || 0)) + (+(s || 0)) - const url = buildVideoLink({ startTime: t }) + + const url = decorateVideoLink({ + url: buildVideoLink({ shortUUID: videoShortUUID }), + startTime: t + }) return `${str}` }) }