From 040467f5c8cba429176423d5e4b83bf5379ad101 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 31 Jul 2018 15:26:48 +0200 Subject: Try to handle truncated markdown links --- client/src/app/videos/+video-watch/video-watch.component.ts | 3 +-- client/src/app/videos/shared/markdown.service.ts | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index afbb0c596..995fb8e2b 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -10,7 +10,7 @@ import { forkJoin, Subscription } from 'rxjs' import * as videojs from 'video.js' import 'videojs-hotkeys' import * as WebTorrent from 'webtorrent' -import { ResultList, UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared' +import { UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared' import '../../../assets/player/peertube-videojs-plugin' import { AuthService, ConfirmService } from '../../core' import { RestExtractor, VideoBlacklistService } from '../../shared' @@ -28,7 +28,6 @@ import { environment } from '../../../environments/environment' import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' import { VideoCaptionService } from '@app/shared/video-caption' import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' -import { VideoJSCaption } from '../../../assets/player/peertube-videojs-typings' @Component({ selector: 'my-video-watch', diff --git a/client/src/app/videos/shared/markdown.service.ts b/client/src/app/videos/shared/markdown.service.ts index 14eeba777..3ef16fdb9 100644 --- a/client/src/app/videos/shared/markdown.service.ts +++ b/client/src/app/videos/shared/markdown.service.ts @@ -72,5 +72,6 @@ export class MarkdownService { private avoidTruncatedLinks (html: string) { return html.replace(/]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...') + .replace(/\[[^\]]+\]?\(?([^\)]+)$/, '$1') } } -- cgit v1.2.3