aboutsummaryrefslogtreecommitdiff
path: root/src/services/status_parser/status_parser.js
blob: f1d113dd2a289a4cf1515429515713f12539b99b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sanitize from 'sanitize-html'

export const removeAttachmentLinks = (html) => {
  return sanitize(html, {
    allowedTags: false,
    allowedAttributes: false,
    exclusiveFilter: ({ tag, attribs }) => tag === 'a' && attribs.class.match(/attachment/)
  })
}

export const parse = (html) => {
  return removeAttachmentLinks(html)
}

export default parse