mirror of
https://github.com/atom/atom.git
synced 2026-02-10 14:45:11 -05:00
Add type of invisible as second class in span
This allows hard tabs, leading whitespace, and trailing whitespace to be styled independently.
This commit is contained in:
@@ -72,13 +72,13 @@ class Token
|
||||
|
||||
if invisibles
|
||||
if @isHardTab and invisibles.tab
|
||||
html = html.replace(/^./, "<span class='invisible'>#{invisibles.tab}</span>")
|
||||
html = html.replace(/^./, "<span class='invisible hard-tab'>#{invisibles.tab}</span>")
|
||||
else if invisibles.space
|
||||
if hasLeadingWhitespace
|
||||
html = html.replace /^[ ]+/, (match) ->
|
||||
"<span class='invisible'>#{match.replace(/./g, invisibles.space)}</span>"
|
||||
"<span class='invisible leading-whitespace'>#{match.replace(/./g, invisibles.space)}</span>"
|
||||
if hasTrailingWhitespace
|
||||
html = html.replace /[ ]+$/, (match) ->
|
||||
"<span class='invisible'>#{match.replace(/./g, invisibles.space)}</span>"
|
||||
"<span class='invisible trailing-whitespace'>#{match.replace(/./g, invisibles.space)}</span>"
|
||||
|
||||
html
|
||||
|
||||
Reference in New Issue
Block a user