We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0062158 commit 61adcddCopy full SHA for 61adcdd
1 file changed
src/Action.js
@@ -49,9 +49,9 @@ export class Action {
49
appendAnswer(buffer) {
50
let string = new TextDecoder().decode(buffer);
51
this.status = STATUS_ANSWER_PARTIALLY_RECEIVED;
52
- this.answer += string;
53
- if (!this.answer.replace(/\r/g, '').endsWith('\n\n')) return;
54
- let lines = this.answer.split(/\r?\n/);
+ this.answer += string.replace(/\r/g, '');
+ if (!this.answer.endsWith('\n\n') && this.answer !== '\n') return;
+ let lines = this.answer.split(/\n/);
55
if (lines.length > 0 && lines[lines.length - 1] === '') {
56
lines = lines.filter((line) => line);
57
this.status = STATUS_ANSWER_RECEIVED;
0 commit comments