File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -799,12 +799,16 @@ def print_formatted_text(
799
799
output .reset_attributes ()
800
800
last_attrs = attrs
801
801
802
- # Eliminate carriage returns
803
- text = text .replace ("\r " , "" )
804
-
805
- # Assume that the output is raw, and insert a carriage return before
806
- # every newline. (Also important when the front-end is a telnet client.)
807
- output .write (text .replace ("\n " , "\r \n " ))
802
+ # Print escape sequences as raw output
803
+ if "[ZeroWidthEscape]" in style_str :
804
+ output .write_raw (text )
805
+ else :
806
+ # Eliminate carriage returns
807
+ text = text .replace ("\r " , "" )
808
+ # Insert a carriage return before every newline (important when the
809
+ # front-end is a telnet client).
810
+ text = text .replace ("\n " , "\r \n " )
811
+ output .write (text )
808
812
809
813
# Reset again.
810
814
output .reset_attributes ()
You can’t perform that action at this time.
0 commit comments