You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
535 B
28 lines
535 B
import Parser from './parser.js'
|
|
import * as DOMPurify from 'dompurify'
|
|
|
|
/**
|
|
* Parser for "text" in Json, is used by slack
|
|
*
|
|
* @author Björn Hase
|
|
* @license hhttps://www.gnu.org/licenses/gpl-3.0.en.html GPL-3
|
|
* @link https://gitea.node001.net/HerrHase/tellme-bot.git
|
|
*
|
|
*/
|
|
class Text extends Parser {
|
|
|
|
/**
|
|
*
|
|
*
|
|
*/
|
|
parse() {
|
|
|
|
// check for msg and clean it
|
|
if (this.body.text) {
|
|
this.message = DOMPurify.sanitize(this.body.text)
|
|
}
|
|
}
|
|
}
|
|
|
|
export default Text
|