Code formatting issues

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Code formatting issues

Postby jazz » August 31st, 2016, 5:12 am

I'm not sure if this is a function of the PHP Tools extension, but I thought I would put it out there in case and people can hopefully direct me in the right direction. I'm still kinda new to VS so be nice. ;)

I have an annoying issue with formatting and inline HTML at the moment. Basically I'm in the process of re-tooling an old crusty website where whoever built it thought it would be cool to put <sup>&reg;</sup> after EVERY time the company name is mentioned, which is a lot.

Problem is, when I format my code, it puts the <sup> on a new line and removes the space after the closing tag. So this:

Code: Select all
<p>We here at ABC Ltd<sup>&reg;</sup> do things.</p>


will become this:

Code: Select all
<p>
    We here at ABC Ltd
    <sup>&reg;</sup>do things.
</p>


It also does it with <i>, <b>, etc. The problem this introduces is unwanted white-space characters when the HTML is rendered. Meaning there's a space between the "ABC Ltd" and the &reg; character. Not to mention the missing space after, which just makes the whole thing render like a mess.

So is this a PHP Tools issue because I'm writing this in a PHP file?

Any help would be appreciated. Thanks.
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: Code formatting issues

Postby Disclosure » September 3rd, 2016, 7:36 pm

I think I had a similar issue editing html in Visual Studio before where it would do that to links, which was the most annoying, so it may not be necessarily PHP Tools related.
Disclosure
 
Posts: 29
Joined: September 21st, 2015, 6:37 pm

Re: Code formatting issues

Postby jazz » September 6th, 2016, 3:13 pm

Only seems to do it when I use the PHP editor. Using HTML editor it formats fine for me.
Try Hazaar MVC - http://www.hazaarmvc.com
The MVC Framework that makes PHP not suck!

Image
User avatar
jazz
 
Posts: 41
Joined: August 25th, 2016, 1:59 am
Location: Canberra, Australia

Re: Code formatting issues

Postby Miloslav Beno » September 8th, 2016, 2:12 pm

Hi guys,

Thanks for letting us know.

Since VS2015 we are using our own HTML formatting instead of Visual Studio formatting. We had to do it because of various issues when mixing Visual Studio HTML editor with our PHP editor.

We will take a look at what we could do to improve our html formatting to handle these cases better.

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Code formatting issues

Postby Sean.Devoy » October 29th, 2016, 6:37 pm

HI,

Just demoing this and wanted to buy, but I think I am losing to much other stuff!

If I edit a PHP file in VS2015, I lose all the helpful HTML intellisense. For example, editing html, if I type <div ...> intellitype adds </div> immediately. Other features like placing the cursor over an opening or closing tag, highlights the matching tag - gone.

Have I missed something? Not turned something on or configured properly?

Or perhaps, this is not the product for me?
Thanks,
Sean
Sean.Devoy
 
Posts: 3
Joined: October 29th, 2016, 6:27 pm

Re: Code formatting issues

Postby Miloslav Beno » November 4th, 2016, 3:12 pm

Hello Sean,

It seems Microsoft HTML Editor is turned off. Please take a look at Tools | Options | PHP Tools | Advanced | Enabled HTML Editor = TRUE

This will instruct us to use MS HTML editor which has all the features you want.

Please let me know if that helped.

Thanks!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 13 guests

cron

User Control Panel

Login

Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 5 minutes)
Most users ever online was 399 on April 19th, 2024, 11:49 pm

Users browsing this forum: No registered users and 13 guests