lib/textblock.js
function(source, ctx) {
  if (source.hasOwnProperty('format')) {
    if (validateFormats.hasOwnProperty(source.format)) {
      return validateFormats[source.format](source, ctx);
    } else {
      throw new Error('invalid format for textblock: ' + source.format);
    }
  }
  throw new Error('invalid format for textblock (did you pass an Object in?)');
}
function(source, ctx) {
  if (source.hasOwnProperty('format')) {
    if (validateFormats.hasOwnProperty(source.format)) {
      return validateFormats[source.format](source, ctx);
    } else {
      throw new Error('invalid format for textblock: ' + source.format);
    }
  }
  throw new Error('invalid format for textblock (did you pass an Object in?)');
}
function ( source , ctx ) { if ( source . hasOwnProperty ( 'format' ) ) { if ( validateFormats . hasOwnProperty ( source . format ) ) { return validateFormats [ source . format ] ( source , ctx ) ; } else { throw new Error ( 'invalid format for textblock: ' + source . format ) ; } } throw new Error ( 'invalid format for textblock (did you pass an Object in?)' ) ; }
Validate a text blocks
@param {String} source The source untrusted text block
@param {Object} ctx An object to be passed to all of the rendering functions
@return {Object} a cleaned text block
Validate a text blocks