pleroma-fe/src/services/status_parser/status_parser.js

16 lines
361 B
JavaScript
Raw Normal View History

import sanitize from 'sanitize-html'
export const removeAttachmentLinks = (html) => {
return sanitize(html, {
allowedTags: false,
allowedAttributes: false,
2016-11-13 09:18:27 +11:00
exclusiveFilter: ({ tag, attribs }) => tag === 'a' && attribs.class.match(/attachment/)
})
}
export const parse = (html) => {
return removeAttachmentLinks(html)
}
export default parse