app/styleguide/js/libs/highlighter/shCore.js
/**
 * Strips <![CDATA[]]> from <SCRIPT /> content because it should be used
 * there in most cases for XHTML compliance.
 * @param {String} original Input code.
 * @return {String} Returns code without leading <![CDATA[]]> tags.
 */
Strips   from  content because it should be used
there in most cases for XHTML compliance.
@param {String} original Input code.
@return {String} Returns code without leading   tags.
Strips from content because it should be used there in most cases for XHTML compliance . @param { String } original Input code . @return { String } Returns code without leading tags .
function stripCData(original)
{
  var left = '<![CDATA[',
    right = ']]>',
    copy = trim(original),
    changed = false,
    leftLength = left.length,
    rightLength = right.length
    ;
  if (copy.indexOf(left) == 0)
  {
    copy = copy.substring(leftLength);
    changed = true;
  }
  var copyLength = copy.length;
  if (copy.indexOf(right) == copyLength - rightLength)
  {
    copy = copy.substring(0, copyLength - rightLength);
    changed = true;
  }
  return changed ? copy : original;
}
function stripCData ( original ) { var left = '<![CDATA[' , right = ']]>' , copy = trim ( original ) , changed = false , leftLength = left . length , rightLength = right . length ; if ( copy . indexOf ( left ) == 0 ) { copy = copy . substring ( leftLength ) ; changed = true ; } var copyLength = copy . length ; if ( copy . indexOf ( right ) == copyLength - rightLength ) { copy = copy . substring ( 0 , copyLength - rightLength ) ; changed = true ; } return changed ? copy : original ; }
Strips <!
Strips <!
// for some reason IE inserts some leading blanks here