mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
helpers/text: when strip colours, also strip special characters
Fixes build failures introduced in
a293f1f3aa
This commit is contained in:
parent
05a3ba7426
commit
c220c40892
1 changed files with 1 additions and 1 deletions
|
@ -31,7 +31,7 @@ class Pry
|
|||
# @param [String, #to_s] text
|
||||
# @return [String] _text_ stripped of any color codes.
|
||||
def strip_color(text)
|
||||
text.to_s.gsub(/\e\[.*?(\d)+m/ , '')
|
||||
text.to_s.gsub(/(\001)?\e\[.*?(\d)+m(\002)?/ , '')
|
||||
end
|
||||
|
||||
# Returns _text_ as bold text for use on a terminal.
|
||||
|
|
Loading…
Add table
Reference in a new issue