… | |
… | |
1412 | |
1412 | |
1413 | # create single paragraphs (very hackish) |
1413 | # create single paragraphs (very hackish) |
1414 | s/(?<=\S)\n(?=\w)/ /g; |
1414 | s/(?<=\S)\n(?=\w)/ /g; |
1415 | |
1415 | |
1416 | # compress some whitespace |
1416 | # compress some whitespace |
1417 | 1 while s/\s*\n\s*\n\s*/\n/; |
1417 | s/\s+\n/\n/g; # ws line-ends |
|
|
1418 | s/\n\n+/\n/g; # double lines |
|
|
1419 | s/^\n+//; # beginning lines |
|
|
1420 | s/\n+$//; # ending lines |
1418 | |
1421 | |
1419 | $_ |
1422 | $_ |
1420 | } |
1423 | } |
1421 | |
1424 | |
1422 | sub hintmode { |
1425 | sub hintmode { |
… | |
… | |
2404 | sub cf::client::send_msg { |
2407 | sub cf::client::send_msg { |
2405 | my ($self, $color, $type, $msg, @extra) = @_; |
2408 | my ($self, $color, $type, $msg, @extra) = @_; |
2406 | |
2409 | |
2407 | $msg = $self->pl->expand_cfpod ($msg); |
2410 | $msg = $self->pl->expand_cfpod ($msg); |
2408 | |
2411 | |
|
|
2412 | return unless @extra || length $msg; |
|
|
2413 | |
2409 | if ($self->can_msg) { |
2414 | if ($self->can_msg) { |
2410 | $self->send_packet ("msg " . $self->{json_coder}->encode ([$color, $type, $msg, @extra])); |
2415 | $self->send_packet ("msg " . $self->{json_coder}->encode ([$color, $type, $msg, @extra])); |
2411 | } else { |
2416 | } else { |
2412 | # replace some tags by gcfclient-compatible ones |
2417 | # replace some tags by gcfclient-compatible ones |
2413 | for ($msg) { |
2418 | for ($msg) { |