Add safe Markdown parsing to CommentService
This commit is contained in:
parent
6418cd64b6
commit
17d67900c1
@ -13,6 +13,7 @@ export class Markdown {
|
|||||||
|
|
||||||
parse(markdown: string): string {
|
parse(markdown: string): string {
|
||||||
const dangerousHTML = marked(markdown, this.markdownOptions)
|
const dangerousHTML = marked(markdown, this.markdownOptions)
|
||||||
return sanitize(dangerousHTML, this.sanitizeOptions)
|
const sanitizedHTML = sanitize(dangerousHTML, this.sanitizeOptions)
|
||||||
|
return sanitizedHTML.trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ export * from './IUser'
|
|||||||
export * from './IUser'
|
export * from './IUser'
|
||||||
export * from './IUserInTeam'
|
export * from './IUserInTeam'
|
||||||
export * from './IUserTeam'
|
export * from './IUserTeam'
|
||||||
|
export * from './Markdown'
|
||||||
export * from './StringUtils'
|
export * from './StringUtils'
|
||||||
export * from './URLFormatter'
|
export * from './URLFormatter'
|
||||||
export * from './filterProps'
|
export * from './filterProps'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user