Add safe Markdown parsing to CommentService

This commit is contained in:
Jerko Steiner 2019-04-07 13:44:09 +08:00
parent 6418cd64b6
commit 17d67900c1
2 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@ export class Markdown {
parse(markdown: string): string {
const dangerousHTML = marked(markdown, this.markdownOptions)
return sanitize(dangerousHTML, this.sanitizeOptions)
const sanitizedHTML = sanitize(dangerousHTML, this.sanitizeOptions)
return sanitizedHTML.trim()
}
}

View File

@ -9,6 +9,7 @@ export * from './IUser'
export * from './IUser'
export * from './IUserInTeam'
export * from './IUserTeam'
export * from './Markdown'
export * from './StringUtils'
export * from './URLFormatter'
export * from './filterProps'