Skip to content

Commit

Permalink
Handle \r\n correctly
Browse files Browse the repository at this point in the history
It's a single grapheme so other rules are not going to work and it
falls back to ␦.
  • Loading branch information
AlexDaniel committed Aug 30, 2019
1 parent 0572755 commit 61cedc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Whateverable.pm6
Expand Up @@ -169,6 +169,7 @@ multi method filter($response where
#↓ Regular response (not a gist)
multi method filter($text is copy) {
ansi-to-irc($text).trans:
β€œ\r\n” => β€˜ββ€β€™,
β€œ\n” => β€˜β€β€™,
3.chr => 3.chr, 0xF.chr => 0xF.chr, # keep these for IRC colors
|((^32)Β».chr Z=> (0x2400..*).map(*.chr)), # convert all unreadable ASCII crap
Expand Down
4 changes: 4 additions & 0 deletions xt/evalable.t
Expand Up @@ -121,6 +121,10 @@ $t.test(β€˜β€ works like an actual newline’,
/^ <me($t)>β€˜, rakudo-moar ’<sha>β€˜: OUTPUT: Β«hello world!␀»’ $/);
}

$t.test(β€˜special characters (\r\n)’,
β€˜e: say β€œ\r\n”’,
/^ <me($t)>β€˜, rakudo-moar ’<sha>β€˜: OUTPUT: «␍␀»’ $/);

# URLs

$t.test(β€˜fetching code from urls’,
Expand Down

0 comments on commit 61cedc1

Please sign in to comment.