WordPress.org

Make WordPress Core

Opened 8 weeks ago

Closed 8 weeks ago

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

Malformed string in code example

Reported by: 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
8 weeks 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.