kitchen-site icon indicating copy to clipboard operation
kitchen-site copied to clipboard

Escaped content triggers syntax errors prevent 'save' in new GUI

Open anthonymanzo opened this issue 8 years ago • 3 comments

I know this is the 'old' site, let me know if this issue belongs somewhere else. Here's a screenshot of a segment of the kitchen.json file I sent you separately: screen shot 2017-01-12 at 7 44 21 pm

anthonymanzo avatar Jan 13 '17 03:01 anthonymanzo

@anthonymanzo json by standard cannot accept newlines inside names nor values.

Meteor Kitchen CLI can "eat" this because I made json parser and I made it to ignore newlines. But, kitchen-GUI is using standard JSON.parse() which doesn't allow newlines.

BTW, if you type in a GUI, for example "helpers_code" from your screenshot using normal kitchen-GUI "code" tab for that, newlines will be properly escaped with \n and your json will be valid.

Screenshots are showing helpers written in GUI and how that looks in json.

Place where you should write code, normally as you do in editor, with newlines etc - you don't need to escape the code:

screen shot 2017-01-13 at 2 23 54 pm

Now see .json - it is automatically escaped and valid:

screen shot 2017-01-13 at 2 28 46 pm

perak avatar Jan 13 '17 13:01 perak

Hi, I’m trying to use the GUI but fox and chrome get stuck when I’m trying to switch from ‘Server’ or ‘Client’ windows. I also removed all the line breaks from the kitchen json file - same result but no visible errors in the IDE, just a pop up ‘Error parsing Json’ I’m going to move back to the cli and just use a custom component for the interim, I have a deadline on this project. Thanks, Tony

On Jan 13, 2017, at 5:31 AM, Petar Korponaić <[email protected]mailto:[email protected]> wrote:

@anthonymanzohttps://github.com/anthonymanzo json by standard cannot accept newlines inside names nor values.

Meteor Kitchen CLI can "eat" this because I made json parser and I made it to ignore newlines. But, kitchen-GUI is using standard JSON.parse() which doesn't allow newlines.

BTW, if you type in a GUI, for example "helpers_code" from your screenshot using normal kitchen-GUI "code" tab for that, newlines will be properly escaped with \n and your json will be valid.

Screenshots are showing helpers written in GUI and how that looks in json.

Place where you should write code, normally as you do in editor, with newlines etc - you don't need to escape the code:

[screen shot 2017-01-13 at 2 23 54 pm]https://cloud.githubusercontent.com/assets/5630814/21931629/bc57d986-d99c-11e6-9cd7-283106f119ce.png

Now see .json - it is automatically escaped and valid:

[screen shot 2017-01-13 at 2 28 46 pm]https://cloud.githubusercontent.com/assets/5630814/21931655/e22aeefa-d99c-11e6-838f-977e24d1f508.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/perak/kitchen-site/issues/361#issuecomment-272443158, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AH95W5fCUB6iwRmLqz0yrvySNxtm4ZOmks5rR3yUgaJpZM4Lif7b.

anthonymanzo avatar Jan 13 '17 19:01 anthonymanzo

@anthonymanzo OK, I understand deadline :) Please when you find some time, let's solve your problem - I am curious is it bug with kitchen-GUI so I can fix it, or you are doing something wrong.

perak avatar Jan 13 '17 19:01 perak