app/styleguide/js/libs/highlighter/shCore.js
/**
 * Executes a callback on each line and replaces each line with result from the callback.
 * @param {Object} str      Input string.
 * @param {Object} callback   Callback function taking one string argument and returning a string.
 */
Executes a callback on each line and replaces each line with result from the callback.
@param {Object} str      Input string.
@param {Object} callback   Callback function taking one string argument and returning a string.
Executes a callback on each line and replaces each line with result from the callback . @param { Object } str Input string . @param { Object } callback Callback function taking one string argument and returning a string .
function eachLine(str, callback)
{
  var lines = splitLines(str);
  for (var i = 0; i < lines.length; i++)
    lines[i] = callback(lines[i], i);
  return lines.join('\r\n');
}
function eachLine ( str , callback ) { var lines = splitLines ( str ) ; for ( var i = 0 ; i < lines . length ; i ++ ) lines [ i ] = callback ( lines [ i ] , i ) ; return lines . join ( '\r\n' ) ; }
Executes a callback on each line and replaces each line with result from the callback.
Executes a callback on each line and replaces each line with result from the callback .
// include \r to enable copy-paste on windows (ie8) without getting everything on one line