src/dom/createElement.js
function createElement(value) {
  if (!document) return null;

  assertType(value, 'string', true, 'Value must be a string');

  if (value.match(/^([a-z0-9]+-)+[a-z0-9]+$/)) {
    return new (getElementRegistry(value))();
  }
  else {
    let div = document.createElement('div');
    if (value.indexOf('<') !== 0 && value.indexOf('>') !== (value.length - 1)) value = `<${value}>`;
    div.innerHTML = value;
    return div.firstChild;
  }
}
function createElement(value) {
  if (!document) return null;

  assertType(value, 'string', true, 'Value must be a string');

  if (value.match(/^([a-z0-9]+-)+[a-z0-9]+$/)) {
    return new (getElementRegistry(value))();
  }
  else {
    let div = document.createElement('div');
    if (value.indexOf('<') !== 0 && value.indexOf('>') !== (value.length - 1)) value = `<${value}>`;
    div.innerHTML = value;
    return div.firstChild;
  }
}
function createElement ( value ) { if ( ! document ) return null ; assertType ( value , 'string' , true , 'Value must be a string' ) ; if ( value . match ( / ^([a-z0-9]+-)+[a-z0-9]+$ / ) ) { return new ( getElementRegistry ( value ) ) ( ) ; } else { let div = document . createElement ( 'div' ) ; if ( value . indexOf ( '<' ) !== 0 && value . indexOf ( '>' ) !== ( value . length - 1 ) ) value = ` ${ value } ` ; div . innerHTML = value ; return div . firstChild ; } }
Creates a DOM element from the provided string.

@param {string} value - String describing the DOM element.

@return {Node} DOM element.

@alias module:requiem~dom.createElement
Creates a DOM element from the provided string .