I understand that php-cs-fixer is used when beautifying a php file and that it won't beautify html because it is simply not php and I also understand that you can't just make php-cs-fixer also fix html because its a third-party thing. But there is no way to beautify html that lives inside a php file?
I would like to suggest maybe adding an option where it will beautify the highlighted text with the beautifier you want. For example if i'm in a php file and I highlight a bunch of html then right click, hover over beautify contents where another list drops down where you can select php-cs-fixer or js-beautify or whatever script you want to use on the selected text.
I also want to say nice job, this thing is really sweet and amazing when I do CSS and JS. For now I have another file name formating.html where I'll copy the html into, beautify it and copy it back. I'm definitely open to any other suggestions should they work any nicer.
Somebody would need to extend php-cs-fixer so that it can parse HTML apart from its PHP code and then these HTML fragments to a different beautifier.
Seriously why doesn't this work out-of-the-box? PHP files tend to have lots of html embedded.
Seriously why doesn't this work out-of-the-box? PHP files tend to have lots of html embedded.
@jason-engage : This is a question for https://github.com/FriendsOfPHP/PHP-CS-Fixer . I recommend asking it there.
But there is no way to beautify html that lives inside a php file?
@kylerdmoore: I think https://github.com/Glavin001/atom-beautify/issues/457 will address this once it is ready.
I would like to suggest maybe adding an option where it will beautify the highlighted text with the beautifier you want.
Maybe https://github.com/Glavin001/atom-beautify/issues/27 is what you're looking for.
I am going to close this as a duplicate because there are other issues which are aimed at solving this problem with PHP+HTML and similar issues. I recommend subscribing to those issues and providing any feedback you have. Thanks!
I should look at extending Pretty Diff's JavaScript parser to also support PHP. I have a PHP issue in Pretty Diff to open parsing to third party (non-JavaScript/non-Node) libraries asynchronously. Extending support to PHP would be a far easier solution than revising the architecture of the entire application even if it opens superior scaling benefits.
Most helpful comment
I should look at extending Pretty Diff's JavaScript parser to also support PHP. I have a PHP issue in Pretty Diff to open parsing to third party (non-JavaScript/non-Node) libraries asynchronously. Extending support to PHP would be a far easier solution than revising the architecture of the entire application even if it opens superior scaling benefits.