 textUtils = require './text-utils'
 
 WhitespaceRegexesByTabLength = {}
-LeadingWhitespaceRegex = /^[ ]+/
-TrailingWhitespaceRegex = /[ ]+$/
+LeadingSpaceRegex = /^[ ]+/
+TrailingSpaceRegex = /[ ]+$/
 EscapeRegex = /[&"'<>]/g
 CharacterRegex = /./g
 StartCharacterRegex = /^./

      leadingHtml = ''
      trailingHtml = ''

      if @hasLeadingWhitespace and match = LeadingWhitespaceRegex.exec(@value)
        classes = 'leading-whitespace'
        classes += ' indent-guide' if hasIndentGuide
        classes += ' invisible-character' if invisibles.space


        startIndex = match[0].length

      if @hasTrailingWhitespace and match = TrailingSpaceRegex.exec(@value)
        tokenIsOnlyWhitespace = match[0].length is @value.length
        classes = 'trailing-whitespace'
        classes += ' indent-guide' if hasIndentGuide and not @hasLeadingWhitespace and tokenIsOnlyWhitespace
