Take a look at this
/**
* Wraps each line of the string into <code/> tag with given style applied to it.
*
* @param {String} str Input string.
* @param {String} css Style name to apply to the string.
* @return {String} Returns input string with each line surrounded by <span/> tag.
*/
function wrapLinesWithCode(str, css)
{
if (str == null || str.length == 0 || str == '\n')
return str;
str = str.replace(/</g, '<');
// Replace two or more sequential spaces with leaving last space untouched.
str = str.replace(/ {2,}/g, function(m)
{
var spaces = '';
for (var i = 0, l = m.length; i < l - 1; i++)
spaces += sh.config.space;
return spaces + ' ';
});
// Split each line and apply <span class="...">...</span> to them so that
// leading spaces aren't included.
if (css != null)
str = eachLine(str, function(line)
{
if (line.length == 0)
return '';
var spaces = '';
line = line.replace(/^( | )+/, function(s)
{
spaces = s;
return '';
});
if (line.length == 0)
return spaces;
return spaces + '<code class="' + css + '">' + line + '</code>'; <------
});
return str;
};
This seems to be the issue I think. It's in the xcode core function.