Skip to content

Non-standard whitespace handling #46

@ak1394

Description

@ak1394

The scanner in node-jsonc-parser allows multiple non-standard whitespace chars to be accepted as a whitespace:

function isWhiteSpace(ch: number): boolean {

However, JSON specification allows only a handful of whitespace chars:

  ws = *(
          %x20 /              ; Space
          %x09 /              ; Horizontal tab
          %x0A /              ; Line feed or New line
          %x0D )              ; Carriage return

Difference in whitespace handling leads to interop problems with other JSON parsers, where input successfully parsed by node-jsonc-parser would fail to parse in Node or Python.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions