if (!markdown) return ''
const html = this.textMarkdownIt.render(markdown)
- return this.avoidTruncatedLinks(html)
+ return this.avoidTruncatedTags(html)
}
enhancedMarkdownToHTML (markdown: string) {
if (!markdown) return ''
const html = this.enhancedMarkdownIt.render(markdown)
- return this.avoidTruncatedLinks(html)
+ return this.avoidTruncatedTags(html)
}
private createMarkdownIt (rules: string[]) {
}
}
- private avoidTruncatedLinks (html: string) {
+ private avoidTruncatedTags (html: string) {
return html.replace(/\*\*?([^*]+)$/, '$1')
.replace(/<a[^>]+>([^<]+)<\/a>\s*...((<\/p>)|(<\/li>)|(<\/strong>))?$/mi, '$1...')
.replace(/\[[^\]]+\]?\(?([^\)]+)$/, '$1')