Use string concatenation instead of array concatenation

This commit is contained in:
probablycorey 2013-10-21 15:17:41 -07:00
parent 5e3d52927a
commit d21a5a6836

View File

@ -165,17 +165,15 @@ class Token
endIndex = match.index
fragments = [leadingHtml]
html = leadingHtml
if @value.length > MaxTokenLength
while startIndex < endIndex
fragments.push "<span>" + @escapeString(@value, startIndex, startIndex + MaxTokenLength) + "</span>"
html += "<span>" + @escapeString(@value, startIndex, startIndex + MaxTokenLength) + "</span>"
startIndex += MaxTokenLength
else
fragments.push @escapeString(@value, startIndex, endIndex)
html += @escapeString(@value, startIndex, endIndex)
fragments.push trailingHtml
html = fragments.join('')
html += trailingHtml
html
escapeString: (str, startIndex, endIndex) ->