Try to handle truncated markdown links

This commit is contained in:
Chocobozzz 2018-07-31 15:26:48 +02:00
parent cf7a61b5a2
commit 040467f5c8
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import { forkJoin, Subscription } from 'rxjs'
import * as videojs from 'video.js' import * as videojs from 'video.js'
import 'videojs-hotkeys' import 'videojs-hotkeys'
import * as WebTorrent from 'webtorrent' 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 '../../../assets/player/peertube-videojs-plugin'
import { AuthService, ConfirmService } from '../../core' import { AuthService, ConfirmService } from '../../core'
import { RestExtractor, VideoBlacklistService } from '../../shared' import { RestExtractor, VideoBlacklistService } from '../../shared'
@ -28,7 +28,6 @@ import { environment } from '../../../environments/environment'
import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
import { VideoCaptionService } from '@app/shared/video-caption' import { VideoCaptionService } from '@app/shared/video-caption'
import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model'
import { VideoJSCaption } from '../../../assets/player/peertube-videojs-typings'
@Component({ @Component({
selector: 'my-video-watch', selector: 'my-video-watch',

View File

@ -72,5 +72,6 @@ export class MarkdownService {
private avoidTruncatedLinks (html: string) { private avoidTruncatedLinks (html: string) {
return html.replace(/<a[^>]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...') return html.replace(/<a[^>]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...')
.replace(/\[[^\]]+\]?\(?([^\)]+)$/, '$1')
} }
} }