Services Plugins FAQs

Code Syntax Plugin: How to preserve space and line breaks

Recently bought the Code Syntax Plugin, and it does exactly what I want, except for one small thing.

It seems to trim all the space and line breaks of any code I use it with, which makes it very unfriendly to read. Example below:

It turns this:

var myObj = new GlideRecord(‘table_name’);

// 2. Build query
myObj.addQuery(‘field_name’,‘operator’,‘value’);
myObj.addQuery(‘field_name’,‘operator’,‘value’);

// 3. Execute query
myObj.query();

// 4. Process returned records
while(myObj.next()){
//Logic you want to execute.
//Use myObj.field_name to reference record fields
}

into this:

var myObj = new GlideRecord(‘table_name’); // 2. Build query myObj.addQuery(‘field_name’,‘operator’,‘value’); myObj.addQuery(‘field_name’,‘operator’,‘value’); // 3. Execute query myObj.query(); // 4. Process returned records while(myObj.next()){ //Logic you want to execute. //Use myObj.field_name to reference record fields }

Is there any setting or technique I can use to avoid this? Thanks!

Hello, @duelarm
Thanks for reaching out :slightly_smiling_face:

I’ve checked the plugin functionality and it works properly. However, we defined that you have some mistakes in the syntaxis.
Please note that you should use not ’, as in your code, but '.

So, please check the symbols and try one more time.

In case you will face an additional error - let me know.
Best regards,