1
0
Fork 0

Avoid to linkify truncated links

This commit is contained in:
Chocobozzz 2018-01-23 16:32:49 +01:00
parent e494f91e67
commit 63c4b44961
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -35,6 +35,9 @@ export class MarkdownService {
}
markdownToHTML (markdown: string) {
return this.markdownIt.render(markdown)
const html = this.markdownIt.render(markdown)
// Avoid linkify truncated links
return html.replace(/<a[^>]+>([^<]+)<\/a>\s*...(<\/p>)?$/mi, '$1...')
}
}