...

View Full Version : How to Do New Line In Source Code?



Scriptet
09-16-2009, 06:54 PM
Hi,

Just a quick question,

Say i'm just doing a simple loop which in it outputs a bunch of <li></li>

Now this is fine, but say I go to view the page in my source code all the <li>'s are on the same line, is there a way I can get them to appear on a new line in the Source Code?

I just need it so I know what's going on when I view my page from the Source Code.

ckeyrouz
09-16-2009, 06:56 PM
Make a regular expression replace.
Replace the following:

</li><li>
with this:

</li>\n<li>

Do not forget to use regular expression replace.

Another thing, it might be that your editor does not contain a regular expression search (notepad for example).

angst
09-16-2009, 07:07 PM
like this for a new line;
[code]<li></li>\n[code]

like this for a tab and a new line;
[code]\t<li></li>\n[code]

this will help keep your source nicely formatted.

abduraooft
09-17-2009, 07:48 AM
..and keep in mind that you need to use double quotes for wrapping those special characters.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum