Skip to content

Not returning required flag for trailing CR LF #27

Open
@toptensoftware

Description

If a string ends with '\r\n' the final returned line break position doesn't have the 'required' flag set.

This line should include a check and return appropriately:

return new Break(this.string.length);

eg: perhaps this:

var required = (this.curClass === BK) || ((this.curClass === CR) && (this.nextClass !== LF));
return new Break(this.string.length, required)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions