powerpack icon indicating copy to clipboard operation
powerpack copied to clipboard

Bug found in String#strip_margin

Open perlawk opened this issue 6 years ago • 0 comments

There is a bug in the string#strip_margin methods The example given: "|def abc\n|xyz".strip_margin("|") # same string, not work but " |def abc\n |xyz".strip_margin("|") # => "def abc\nxyz" because in the source code gsub(/^\s+#{margin}/, "") so, either change the example in web document or source code to /^\s*#{margin}/, thank you for your attention.

perlawk avatar Apr 14 '19 13:04 perlawk