Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47598 closed defect (bug) (reported-upstream)

Malformed string in code example

Reported by: avenirer's profile avenirer Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: WordPress.org Site Keywords:
Focuses: docs Cc:

Description

In here: https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/#multi-line-statements

// Bad
var html = '<p&gt;The sum of ' + a + ' and ' + b + ' plus ' + c
    + ' is ' + ( a + b + c ) + '</p&gt;;
 
// Good
var html = '<p&gt;The sum of ' + a + ' and ' + b + ' plus ' + c +
    ' is ' + ( a + b + c ) + '</p&gt;;

Should be:

// Bad
var html = '<p>The sum of ' + a + ' and ' + b + ' plus ' + c
    + ' is ' + ( a + b + c ) + '</p>';
 
// Good
var html = '<p>The sum of ' + a + ' and ' + b + ' plus ' + c +
    ' is ' + ( a + b + c ) + '</p>';

Change History (1)

#1 @desrosj
5 years ago

  • Component changed from General to WordPress.org site
  • Focuses docs added
  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed
  • Version trunk deleted

Hi @avenirer,

Thanks for creating this issue, and welcome to Trac!

This comes up from time to time. This is an issue with Gutenberg that was surfaced by the Syntax Highlighter Evolved plugin. An issue was created upstream on GitHub, so I am going to close this ticket out as reported upstream. Unfortunately, I’m not sure that this can be fixed until it is addressed upstream.

When the issue is fixed, it should resolve itself. If not, someone will need to do a review of every handbook page that has a Syntax Highlighter Evolved block.

Note: See TracTickets for help on using tickets.