Avoid to linkify truncated links

pull/213/merge
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
1 changed files with 4 additions and 1 deletions

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...')
}
}