'use strict';

class Message {
    constructor(person, text) {
        this.person = person;
        this.text = text;
    }

    toString() {
        return `${this.person} ${this.text}`
    }
}

export default Message;

'use strict';

import $ from 'jquery';

class Message {
    constructor(person, text) {
        this.person = person;
        this.text = text;
    }

    toString() {
        return `${this.person} ${Message.stripTags(this.text)}`
    }

    static stripTags(message) {
        return $('<div>').html(message).text();
    }
}

export default Message;

Support strip tags in messages.
Support strip tags in messages.
