php code formatting is incorrect

Kevin Brogan 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 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