Making WordPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5346 closed defect (bug) (fixed)

Characters like &,<,? does not seem to be showing correctly in some Doc pages

Reported by: kmarcink's profile kmarcink Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Developer Hub Keywords:
Cc:

Description

There seem to be something wrong with the WP coding standards page https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/
Characters like &,<,? does not seem to be showing correctly.

You can find them by searching for example for

  • &amp;
  • &lt;

Attachments (2)

Screenshot 2020-07-31 at 08.12.03.png (33.5 KB) - added by kmarcink 4 years ago.
Screenshot 2020-07-31 at 07.03.26.png (39.8 KB) - added by kmarcink 4 years ago.

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.


4 years ago

#2 @coffee2code
4 years ago

  • Component changed from General to Developer Hub
  • Owner set to coffee2code
  • Status changed from new to accepted

Thanks for the report!

This is an outstanding issue in general that for which the likely culprit is the SyntaxHighlighter Evolved plugin's handling of code shortcodes. Its block handling is superior and doesn't have this issue, but in this case the Code Standards Handbook is fully imported from GitHub, and thus originates as text in a Markdown format.

I believe the issue would be resolved if the source documents avoided the use of code shortcodes (e.g. [php], [html], [css], [javascript], or [code]) and instead used triple backticks (with optional language hinting) without pre-encoding, e.g.

```html
<div class="hfeed">
        <article id="post-" class="">
            <!-- ... -->
        </article>
</div>
```

The Block Editor Handbook is also imported from GitHub and uses backticks (e.g. a source .md file and its resultant handbook page) which could be used for reference.

In the meantime, I'll push up a stopgap "fix" that addresses the display issue.

cc: @netweb

#3 @coffee2code
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 10190:

Developer, Code Standards Handbook: Fix (as a stopgap) double-encoding of HTML entities.

SyntaxHighligher Evolved's handling of HTML entities in code shortcodes is the likely culprit. Use of triple backticks in the source Markdown files to denote code blocks (as done in the Block Editor Handbook) could circumvent the issue.

Props kmarcink, coffee2code.
Fixes #5346.

This ticket was mentioned in Slack in #meta by coffee2code. View the logs.


4 years ago

This ticket was mentioned in Slack in #docs by cbrandt. View the logs.


4 years ago

This ticket was mentioned in Slack in #core-coding-standards by kenshino. View the logs.


4 years ago

#7 @coffee2code
4 years ago

In 10366:

Developer, Code Standards Handbook: Extend double-encoding fix to include single quotes.

Fixes https://github.com/WordPress/wpcs-docs/issues/46.
See #5346.

Note: See TracTickets for help on using tickets.