finnp / json-lexer

Split a JSON String into annotated tokens
15 stars 3 forks source link

[bug] Multiple spaces are replaced with a single space #14

Closed epoberezkin closed 7 years ago

epoberezkin commented 7 years ago

Both in whitespace and inside strings.

var result = lexer("{\n  \"  foo  \": 1\n}");
result.reduce((memo, token) => memo + token.raw, ''); // "{\n \" foo \": 1\n}"
finnp commented 7 years ago

Hey @epoberezkin,

I was not able to reproduce this bug. Can you check again on this? I was testing with version json-lexer@1.1.1. What environment are you running this in?

epoberezkin commented 7 years ago

It's the bug in runkit it seems:

https://runkit.com/esp/587621dc9462c70013b1fd17

They don't show the string correctly. Thank you.

finnp commented 7 years ago

Ah weird, thanks for looking into it 👍

epoberezkin commented 7 years ago

No problem - I sent them a message.