Code formatting issues
6 posts
• Page 1 of 1
Code formatting issues
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>®</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:
will become this:
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 ® 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.
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>®</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>®</sup> do things.</p>
will become this:
- Code: Select all
<p>
We here at ABC Ltd
<sup>®</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 ® 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.
-
jazz - Posts: 41
- Joined: August 25th, 2016, 1:59 am
- Location: Canberra, Australia
Re: Code formatting issues
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
Only seems to do it when I use the PHP editor. Using HTML editor it formats fine for me.
-
jazz - Posts: 41
- Joined: August 25th, 2016, 1:59 am
- Location: Canberra, Australia
Re: Code formatting issues
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,
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. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Code formatting issues
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
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
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!
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. │ @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 13 guests