'kanso upload' handle multi-line strings in json?

34 views
Skip to first unread message

Mike Marino

unread,
Jul 9, 2013, 5:33:29 PM7/9/13
to ka...@googlegroups.com
Hi all,

I understand that the JSON format doesn't allow for multi-line strings, but I believe in principal the kanso upload command should be able to properly parse these out and replace them with '\n'.  At the moment, this doesn't work, e.g.:

> cat tmp.json
 {
  "_id" : "test",
  "astring" : "test \
 +1"
}
> kanso upload -f tmp.json http://127.0.0.1:5984/test
Uploading docs to http://127.0.0.1:5984/test
Reading tmp.json
Error: SyntaxError: Unexpected token 

    at Object.parse (native)
    at ParseStream.Native (/usr/local/lib/node_modules/kanso/lib/data-stream/ParseStream.js:78:26)
    at ParseStream._newToken (/usr/local/lib/node_modules/kanso/node_modules/parser/lib/Parser.js:105:24)

...

This also doesn't work without the "escape" new-line.  I was digging a little to see how difficult it would be to update the parser to properly remove new-lines.  Has anyone already done this?

Cheers,
Mike

Mike Marino

unread,
Jul 10, 2013, 7:03:21 AM7/10/13
to ka...@googlegroups.com
Hi all,

Apologies for answering my own post.  I have opened an issue and attached a pull request here to fix this issue:


Cheers,
Mike
Reply all
Reply to author
Forward
0 new messages