export default (editor, options) => {
  editor.TraitManager.addType('authorInfo', {
    getInputEl() {
      if (!this.input) {
        const { model, ppfx } = this;
        const author = model.get('author');
        const email = model.get('email');
        let authorInfo = [author, email];
        authorInfo = authorInfo.filter(info => !!info);
        authorInfo = authorInfo.join('</br>');
        const className = `${ppfx}authorInfo`;
        const input = `<span class="${className}" style="font-size:12px;line-height:18px;">${authorInfo}</span>`;
        this.input = input;
      }
  
      return this.input;
    },
    renderField() {
      if (!this.$input) {
        const el = this.getInputEl();
        this.$el.find('.' + this.ppfx + 'field').parent().html(el)
      }
    },
  })
}