Connection::Buffer: Prevent modification of line breaks in quotes
After splitting the messages received into lines, we could still have a line break within quotes. Since we just want to modify terminating line breaks, we change the recognition accordingly.
This commit is contained in:
@ -82,7 +82,8 @@ class Runner::Connection::Buffer
|
|||||||
@global_buffer = +''
|
@global_buffer = +''
|
||||||
# For our buffering, we identified line breaks with the `\n` and removed those temporarily.
|
# For our buffering, we identified line breaks with the `\n` and removed those temporarily.
|
||||||
# Thus, we now re-add the `\n` at the end of the string and remove the `\r` at the same time.
|
# Thus, we now re-add the `\n` at the end of the string and remove the `\r` at the same time.
|
||||||
message = message.gsub(/\r$/, "\n")
|
# Still, some messages might still contain a `\r\n` within strings (e.g., received from Python for the linter).
|
||||||
|
message = message.gsub(/\r(?!\n)$/, "\n")
|
||||||
@line_buffer.push message
|
@line_buffer.push message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user