On 18-Feb-2007, at 07:16, Andrew Starr wrote:

I managed to mess up some files and get my easy-to-read-by-human- eyes HTML scrunched down a bit.

Anyone have a grep pattern I could use for search/replace that would give me some white space back?

I like Tidy's Reflow command.

Markup -> Tidy -> Reflow

Might give that a shot before you start mucking about with a grep pattern.

however, to do what you want:

# Find the start of line followed by any number of spaces, followed by <li>
find: ^\s+<li>

#replace with what we searched for (&) prefixed with a blank line
replace: \r&

this will take:

    <ul>
      <li>stuff</li>
      <li>stuff</li>
    </ul>

and transform it to

    <ul>


      <li>stuff</li>


      <li>stuff</li>
    </ul>

for the <br> you would do:

find: ([^$])<br>(^$])
replace: \1\r<br>\r\2

BTW, you should go ahead and get in the habit of using lowercase for HTML as it is required for XML and XHMTL.


--
I wrote this song two hours before we met. I didn't know your name, or what you looked like yet....



--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to