Start a new topic

Posting Code to Forum

How can I stop posts to Kinvey Community from automatically stripping out all space for code I post to these forums?

I have previously update a query with some sample code, and when posted, it is reformatted into one block of solid text, which is extremely difficult to read, and for other members to easily understand the code.

1 person has this question
1 Comment

You have to indent the code by 4 spaces or a tab, like this



function onPreFetch(request, response, modules){

response.body = {'this is':'code'};

response.complete();

}



One tip is that the business logic editor responds to tabs when you have a multi-line selection, so you don't have to indent line by line or paste into something like sublime.



Inline with text you can use blocks but you have to surround them with backticks.

Login or Signup to post a comment