File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -100,14 +100,21 @@ class Char(object):
100100 '\x9e ' : '<9e>' ,
101101 '\x9f ' : '<9f>' ,
102102
103-  '\xa0 ' : '&' , # Non breaking space. 
103+  # For the non-breaking space: visualize like Emacs does by default. 
104+  # (Print a space, but attach the 'nbsp' class that applies the 
105+  # underline style.) 
106+  '\xa0 ' : ' ' ,
104107 }
105108
106109 def  __init__ (self , char = ' ' , style = '' ):
107110 # If this character has to be displayed otherwise, take that one. 
108111 if  char  in  self .display_mappings :
112+  if  char  ==  '\xa0 ' :
113+  style  +=  ' class:nbsp '  # Will be underlined. 
114+  else :
115+  style  +=  ' class:control-character ' 
116+ 
109117 char  =  self .display_mappings [char ]
110-  style  +=  'class:control-character' 
111118
112119 self .char  =  char 
113120 self .style  =  style 
Original file line number Diff line number Diff line change 106106 # Control characters, like ^C, ^X. 
107107 ('control-character' , 'ansiblue' ),
108108
109+  # Non-breaking space. 
110+  ('nbsp' , 'underline ansiyellow' ),
111+ 
109112 # Default styling of HTML elements. 
110113 ('i' , 'italic' ),
111114 ('u' , 'underline' ),
                         You can’t perform that action at this time. 
           
                  
0 commit comments