Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No Shorthand PHP Tags" section of PHP Coding Standards #38

Closed
bizanimesh opened this issue Jun 29, 2020 · 4 comments · Fixed by #39
Closed

"No Shorthand PHP Tags" section of PHP Coding Standards #38

bizanimesh opened this issue Jun 29, 2020 · 4 comments · Fixed by #39

Comments

@bizanimesh
Copy link

The below example of Correct and Incorrect is not available in No Shorthand PHP Tags section of PHP Coding Standards.

Correct:

<?php ... ?>
<?php echo $var; ?>

Incorrect:

<? ... ?>
<?= $var ?>
@diogoca
Copy link

diogoca commented Jul 10, 2020

I checked wordpress-coding-standards/php.md and it's fine. May be some escape function on backend source of developer.wordpress.org that's making print empty.

@bizanimesh
Copy link
Author

Hi Diogo,

Yes, I have also checked wordpress-coding-standards/php.md and all
things are fine there.

So how this problem would be solved?

Do I need to contact any team on Slack?

@ntwb
Copy link
Member

ntwb commented Jul 21, 2020

Ugh, the #39 PR did not resolve this:

image

It's not blank like previously it was, nevertheless will have to investigate further

Most likely. meta ticket will need to be created to add support to the markdown parser to account for this, will follow up with that shortly

cc @coffee2code

@ntwb ntwb reopened this Jul 21, 2020
@coffee2code
Copy link
Contributor

Meant to follow up with this yesterday. Not sure if the ticket closure is a result of this or not, but I closed out this issue as reported on meta.trac in #meta5346.

Here's what I wrote as a comment there that is relevant here:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants