Fix brackets truncation in video description
authorChocobozzz <me@florianbigard.com>
Fri, 29 Nov 2019 09:18:40 +0000 (10:18 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 29 Nov 2019 09:18:40 +0000 (10:18 +0100)
client/src/app/shared/renderer/markdown.service.ts

index 0e24f3085ef93113fd0f6252ebfe79ccd7811b1d..9aec3b4bc8def85be61dc4585c8b103fd1316c40 100644 (file)
@@ -92,7 +92,7 @@ export class MarkdownService {
   private avoidTruncatedTags (html: string) {
     return html.replace(/\*\*?([^*]+)$/, '$1')
       .replace(/<a[^>]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...')
-      .replace(/\[[^\]]+\]?\(?([^\)]+)$/, '$1')
-
+      .replace(/\[[^\]]+\]\(([^\)]+)$/m, '$1')
+      .replace(/\s?\[[^\]]+\]?[.]{3}<\/p>$/m, '...</p>')
   }
 }