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

Linux: PHP-HTML Beautifying does not work #484

Closed
p-hebert opened this issue Jul 26, 2015 · 4 comments
Closed

Linux: PHP-HTML Beautifying does not work #484

p-hebert opened this issue Jul 26, 2015 · 4 comments
Assignees
Milestone

Comments

@p-hebert
Copy link

Ubuntu 14.04 LTS
atom 1.0.2
atom-beautify v0.28.8

Unless I am mistaken, this is a feature request more than an issue.
Atom-beautifier relies on FriendsOfPHP/PHP-CS-Fixer to beautify PHP files.
However PHP-CS-Fixer does not seem to handle HTML code standards. I tested it via command line against a test PHP file with HTML content and the PHP-CS-Fixer failed to format the HTML properly.
I worked through already existing issues, such as #175 and #242 and I didn't find any issue specifically targeting the HTML in PHP files.
I am not sure if this issue has been addressed previously, but if not, I would suggest that PHP files be formatted using the HTML formatter, followed by the PHP-CS-fixer. This would allow global coverage of PHP without conflict between the two formatters.
Until then, the makeshift alternative is to either rename the file to *.html and beautify or to have a second file used only for HTML beautifying, which is less than optimal.

Thanks for your answer!

@kelvix
Copy link
Contributor

kelvix commented Jul 26, 2015

Sounds a bit like #457

@p-hebert
Copy link
Author

The task seems similar indeed. However in this case it looks more than a requirement for proper functionality rather than an option.

@Glavin001
Copy link
Owner

I am going to consider this a duplicate of #457 and recommend that you subscribe to that Issue.
The fact this #457 is a requirements for proper PHP/HTML beautification only makes #457 a higher priority issue, however it does not warrant two issues containing the same concept.

Also, it would help if you could test that this does in fact work:

  • Take a sample PHP/HTML hybrid file
  • Beautify for HTML first
  • Beautify for PHP second
  • Repeat for different orderings if you like

You can change your grammar for the current file by going up into Atom's menu -> View -> Select Grammar, then switch between HTML and PHP, etc.

@Glavin001 Glavin001 self-assigned this Jul 29, 2015
@p-hebert
Copy link
Author

I will test the requested steps and come back to you when I'll be done.

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

No branches or pull requests

3 participants