diff options
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r-- | client/src/app/videos/shared/markdown.service.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/app/videos/shared/markdown.service.ts b/client/src/app/videos/shared/markdown.service.ts index b302d9052..07017eca5 100644 --- a/client/src/app/videos/shared/markdown.service.ts +++ b/client/src/app/videos/shared/markdown.service.ts | |||
@@ -26,14 +26,14 @@ export class MarkdownService { | |||
26 | if (!markdown) return '' | 26 | if (!markdown) return '' |
27 | 27 | ||
28 | const html = this.textMarkdownIt.render(markdown) | 28 | const html = this.textMarkdownIt.render(markdown) |
29 | return this.avoidTruncatedLinks(html) | 29 | return this.avoidTruncatedTags(html) |
30 | } | 30 | } |
31 | 31 | ||
32 | enhancedMarkdownToHTML (markdown: string) { | 32 | enhancedMarkdownToHTML (markdown: string) { |
33 | if (!markdown) return '' | 33 | if (!markdown) return '' |
34 | 34 | ||
35 | const html = this.enhancedMarkdownIt.render(markdown) | 35 | const html = this.enhancedMarkdownIt.render(markdown) |
36 | return this.avoidTruncatedLinks(html) | 36 | return this.avoidTruncatedTags(html) |
37 | } | 37 | } |
38 | 38 | ||
39 | private createMarkdownIt (rules: string[]) { | 39 | private createMarkdownIt (rules: string[]) { |
@@ -70,7 +70,7 @@ export class MarkdownService { | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | private avoidTruncatedLinks (html: string) { | 73 | private avoidTruncatedTags (html: string) { |
74 | return html.replace(/\*\*?([^*]+)$/, '$1') | 74 | return html.replace(/\*\*?([^*]+)$/, '$1') |
75 | .replace(/<a[^>]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...') | 75 | .replace(/<a[^>]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...') |
76 | .replace(/\[[^\]]+\]?\(?([^\)]+)$/, '$1') | 76 | .replace(/\[[^\]]+\]?\(?([^\)]+)$/, '$1') |