VS HTML Code Formatter breaks dynamic PHP
6 posts
• Page 1 of 1
VS HTML Code Formatter breaks dynamic PHP
Great product by the way, I use it all day!
But my problem is I'm working on dynamic html/php (Magento) and the VS html window formatter (Ctrl-k, Ctrl-D but it seems to run the procedure without human intervention as well) breaks the escaped php code, e.g.
turns into:
which doesn't look too bad, but my oh my does it make for some subtle bugs!
I know I should search/replace for two double quotes after working on every file, but I just don't remember.
Is there something obvious I'm missing?
But my problem is I'm working on dynamic html/php (Magento) and the VS html window formatter (Ctrl-k, Ctrl-D but it seems to run the procedure without human intervention as well) breaks the escaped php code, e.g.
- Code: Select all
<input id="search" type="text" name="<?php echo $this->helper('catalogsearch')-blah blah
turns into:
- Code: Select all
<input id="search" type="text" name="" <?php echo $this->helper('catalogsearch')-blah blah
which doesn't look too bad, but my oh my does it make for some subtle bugs!
I know I should search/replace for two double quotes after working on every file, but I just don't remember.
Is there something obvious I'm missing?
- silas2
- Posts: 7
- Joined: February 10th, 2017, 4:13 pm
Re: VS HTML Code Formatter breaks dynamic PHP
Hello!
Thanks for the feedback. We're very glad PHP Tools help you every day
This really seems as a bug. What VS version do you use? and do you have other extensions? I suspect this is not coming from our formatter, maybe default html formatter is somehow activated(we deactivate it and use our own) and messes up the stuff.
Could you send me the whole html code snippet where this happens?
Thanks so much!
Thanks for the feedback. We're very glad PHP Tools help you every day
This really seems as a bug. What VS version do you use? and do you have other extensions? I suspect this is not coming from our formatter, maybe default html formatter is somehow activated(we deactivate it and use our own) and messes up the stuff.
Could you send me the whole html code snippet where this happens?
Thanks so much!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: VS HTML Code Formatter breaks dynamic PHP
I'm using VS2015.
This is looking like a most spooky issue (to me anyway!). I download magento source, create new VS project from existing code.
None of the Magento files get syntax highlighting (and exhibit the formatting issue) in html designer, but when I add a new file pasting the same content as an original Magento souce, and I get full syntax highlighting and bug gone away.
I do a binary + hex comparison of the two files content and they are exactly the same!!! (no Encoding/line ending differences)
I look at the two files in the .proj file (orignal.phtml and test.phtml) and the entries look the same.
I really am scratching my head.
This is looking like a most spooky issue (to me anyway!). I download magento source, create new VS project from existing code.
None of the Magento files get syntax highlighting (and exhibit the formatting issue) in html designer, but when I add a new file pasting the same content as an original Magento souce, and I get full syntax highlighting and bug gone away.
I do a binary + hex comparison of the two files content and they are exactly the same!!! (no Encoding/line ending differences)
I look at the two files in the .proj file (orignal.phtml and test.phtml) and the entries look the same.
I really am scratching my head.
- silas2
- Posts: 7
- Joined: February 10th, 2017, 4:13 pm
Re: VS HTML Code Formatter breaks dynamic PHP
Hello!
Have you assigned phtml files to PHP Editor? https://docs.devsense.com/#file-extension-being-opened-by-php-editor
Have you assigned phtml files to PHP Editor? https://docs.devsense.com/#file-extension-being-opened-by-php-editor
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: VS HTML Code Formatter breaks dynamic PHP
Doh!! Thank you so much, that's fixed it. RTFM.
- silas2
- Posts: 7
- Joined: February 10th, 2017, 4:13 pm
Re: VS HTML Code Formatter breaks dynamic PHP
hehe No problem, I'm glad it was that simple.
Have a good one!
Have a good one!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 85 guests