Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Auto-formatter doesn't break up HTML tags properly
Auto-formatter doesn't break up HTML tags properly [message #1448396] Sun, 19 October 2014 22:45 Go to next message
Dave H is currently offline Dave HFriend
Messages: 43
Registered: January 2010
Member
I use Eclipse's Ctrl+Shift+F auto-formatter to make code easy to edit, but it can fudge up HTML as much as it cleans it up (NetBeans is better in some ways and worse in others). It also seems to break up tag content randomly by attributes; I've gone through settings and can't figure out how to make it format sensibly.

For instance:

	<label for="form_URL">Website</label> <input id="form_URL" maxlength="80" name="URL" size="20" type="text" /> <label
		for="form_industry">Industry</label> <select id="form_industry" name="industry">
		<option value="">- none -</option>


It put four separated tags on the same line: the label tag, then the input tag then the following label tag, then the following select tag. These were all on different lines in the original code (formatted from WordPress), even one separated by two newlines. Nothing I do puts them on their own lines sensibly. All of the option values remained on their own lines indented properly.

Here's how it looked taken from the WordPress "Text" editor:

<label for="form_URL">Website</label>
<input id="form_URL" maxlength="80" name="URL" size="20" type="text" />

<label for="form_industry">Industry</label>
<select id="form_industry" name="industry">
<option value="">- none -</option>


Can someone explain why it's doing this or how to fix it?

[Updated on: Sun, 19 October 2014 22:49]

Report message to a moderator

Re: Auto-formatter doesn't break up HTML tags properly [message #1448423 is a reply to message #1448396] Sun, 19 October 2014 23:53 Go to previous message
Mark Dexter is currently offline Mark DexterFriend
Messages: 324
Registered: July 2009
Senior Member
I have never been able to get the Eclipse PHP formatter to work well with HTML markup and <?php ...?> PHP code. I haven't found any options in the formatter preferences that relate to HTML tags. The formatter seems to be designed for "pure" PHP code files, not files with HTML tags.

If someone knows a way to do this in Eclipse, that would be very helpful.
Previous Topic:Debugging a script with many files using the last version of Eclipse
Next Topic:debug step question
Goto Forum:
  


Current Time: Wed Oct 09 23:32:52 GMT 2024

Powered by FUDForum. Page generated in 0.04015 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top