Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

php code formatting is incorrect

Kevin Brogan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 8, 2018

{code:php}
var aString = 'this is a string with a // in it '.'and a concatenation';
{code}

The syntax highlighter is treating the // in the string as a comment start, but only until the end of the string. This results in everything between the // and the next ' character to be formatted grey as a comment, which is incorrect.

1 answer

0 votes
webcoder
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 25, 2020

Question is old but writing for reference that may be helpful.

The syntax error regarding comment start may have been caused by another syntax error. I have tried this in Netbeans IDE and didn't get any syntax error:

const aString = 'this is a string with a // in it '.'and a concatenation';

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events