<commit_before>var template = require('./template');
var View = require('view');
var dom = require('dom');
var Quill = require('quill');

var defaults = {
  toolbar: {
    fontFace: false,
    fontSize: false,
    fontWidth: true
  },
  theme: 'snow'
};

module.exports = RichTextView;

function RichTextView(el, options) {
  if (!(this instanceof RichTextView)) {
    return new RichTextView(el, options);
  }

  // The original input or textarea element
  this.input = 'string' === typeof el ? dom(el) : el;

  // Settings merged with options provided by callee
  // fixme: i can't find a component that extends the defaults object with the options object.
  //this.settings = options || {};
  this.settings = defaults;
<commit_msg>[richtext] Added description #438<commit_after>var template = require('./template');
var View = require('view');
var dom = require('dom');
var Quill = require('quill');

var defaults = {
  toolbar: {
    fontFace: false,
    fontSize: false,
    fontWidth: true
  },
  theme: 'snow'
};

module.exports = RichTextView;

/**
 * Wraps an input element and converts it in a Quill WYSIWYG control
 * @param {String|HTMLInputElement} Selector or domified single element
 * @param {Object} Customization options
 *
 * Usage:
 *   var richtext = require('richtext');
 *   var input = dom('input#description');
 *   richtext(input);
 *
 */
function RichTextView(el, options) {
  if (!(this instanceof RichTextView)) {
    return new RichTextView(el, options);
  }

  // The original input or textarea element
  this.input = 'string' === typeof el ? dom(el) : el;

  // Settings merged with options provided by callee
  // fixme: i can't find a component that extends the defaults object with the options object.
  //this.settings = options || {};
  this.settings = defaults;

{'fraction_non_alphanumeric': 0.12944444444444445, 'fraction_numerical': 0.0016666666666666668, 'mean_word_length': 3.7645502645502646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3677348', 'n_tokens_mistral': 539, 'n_tokens_neox': 523, 'n_words': 182}