mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
readline: fix unicode line separators being ignored
PR-URL: https://github.com/nodejs/node/pull/57591 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jordan Harband <ljharb@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
dfaded80e1
commit
a42bca5fa7
2 changed files with 27 additions and 2 deletions
|
@ -78,8 +78,15 @@ const { StringDecoder } = require('string_decoder');
|
|||
const kHistorySize = 30;
|
||||
const kMaxUndoRedoStackSize = 2048;
|
||||
const kMincrlfDelay = 100;
|
||||
// \r\n, \n, or \r followed by something other than \n
|
||||
const lineEnding = /\r?\n|\r(?!\n)/g;
|
||||
/**
|
||||
* The end of a line is signaled by either one of the following:
|
||||
* - \r\n
|
||||
* - \n
|
||||
* - \r followed by something other than \n
|
||||
* - \u2028 (Unicode 'LINE SEPARATOR')
|
||||
* - \u2029 (Unicode 'PARAGRAPH SEPARATOR')
|
||||
*/
|
||||
const lineEnding = /\r?\n|\r(?!\n)|\u2028|\u2029/g;
|
||||
|
||||
const kLineObjectStream = Symbol('line object stream');
|
||||
const kQuestionCancel = Symbol('kQuestionCancel');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue