Remove attachment links, as we are already showing them.

This commit is contained in:
Roger Braun 2016-11-12 22:41:43 +01:00
parent c9ab70db8e
commit 05733b6bc9
5 changed files with 42 additions and 6 deletions

View file

@ -0,0 +1,15 @@
import sanitize from 'sanitize-html'
export const removeAttachmentLinks = (html) => {
return sanitize(html, {
allowedTags: false,
allowedAttributes: false,
exclusiveFilter: ({ tag, attribs: { class: klass } }) => tag === 'a' && klass.match(/attachment/)
})
}
export const parse = (html) => {
return removeAttachmentLinks(html)
}
export default parse