Loading ...
Sorry, an error occurred while loading the content.

Re: [edit+] How can I delete html spaces

Expand Messages
  • dz@caribe.net
    Let me get this straight, you want to remove all insignificant whitespace between HTML tags? If so, try this in EditPlus: Find what: ( )[ t n]+|[ t n]+(
    Message 1 of 5 , May 19, 2006
    • 0 Attachment
      Let me get this straight, you want to remove all insignificant whitespace between HTML tags?

      If so, try this in EditPlus:
      Find what: (>)[ \t\n]+|[ \t\n]+(<)
      Replace with: \1\2

      [X] Regular expression
      [X] Current file


      Note that the "Find what:" line starts with the parenthesis-angled-backet, not whitespace. Also note that this will not remove whitespace within the tags themselves. For that you'll need to make another pass with a different regular expression. However, it is more difficult, as you need to take into consideration quoted strings and things like that, which EditPlus won't be able to do.

      -dZ.

      ----- Original Message -----
      From: josealberto1975
      Sent: 5/19/2006 8:40:27 AM
      To: editplus@yahoogroups.com
      Subject: [edit+] How can I delete html spaces

      > Hi, I have to delete all HTML spaces (with EditPlus or something).
      > It's too long for manual delete.
      >
      > From this:
      > --
      > <html>
      > <head>
      > </head>
      > <body>
      > <div>
      > <table>
      > <tr>
      > <td>
      > ...
      > </td>
      > </tr>
      > </table>
      > </div>
      > </body>
      > </html>
      >
      >
      > To this:
      > --
      > <html><head></head><body><div><table><tr><td>...</td></tr></table></div>
      > </body></html>
      >
      >
      > Regards,
      > J.A.
      >
      >
      >
      >
      >
      >
      >
      > http://www.editplus.com
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
    • Mark Kahn
      what s wrong with just find: [ t n]+
      Message 2 of 5 , May 19, 2006
      • 0 Attachment
        what's wrong with just

        find: >[\t \n]+<
        replace: ><

        ?

        Also, if you need better regex support, I wrote a tool:

        http://editplus.info/wiki/User_Tools#Full_RegEx_Supported_Replace_and_More.21

        -Mark

        On 5/19/06, dz@... <dz@...> wrote:
        >
        > Let me get this straight, you want to remove all insignificant whitespace
        > between HTML tags?
        >
        > If so, try this in EditPlus:
        > Find what: (>)[ \t\n]+|[ \t\n]+(<)
        > Replace with: \1\2
        >
        > [X] Regular expression
        > [X] Current file
        >
        >
        > Note that the "Find what:" line starts with the parenthesis-angled-backet,
        > not whitespace. Also note that this will not remove whitespace within the
        > tags themselves. For that you'll need to make another pass with a different
        > regular expression. However, it is more difficult, as you need to take into
        > consideration quoted strings and things like that, which EditPlus won't be
        > able to do.
        >
        > -dZ.
        >
        > ----- Original Message -----
        > From: josealberto1975
        > Sent: 5/19/2006 8:40:27 AM
        > To: editplus@yahoogroups.com
        > Subject: [edit+] How can I delete html spaces
        >
        > > Hi, I have to delete all HTML spaces (with EditPlus or something).
        > > It's too long for manual delete.
        > >
        > > From this:
        > > --
        > > <html>
        > > <head>
        > > </head>
        > > <body>
        > > <div>
        > > <table>
        > > <tr>
        > > <td>
        > > ...
        > > </td>
        > > </tr>
        > > </table>
        > > </div>
        > > </body>
        > > </html>
        > >
        > >
        > > To this:
        > > --
        > > <html><head></head><body><div><table><tr><td>...</td></tr></table></div>
        > > </body></html>
        > >
        > >
        > > Regards,
        > > J.A.
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > > http://www.editplus.com
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        > >
        > >
        >
        >
        >
        >
        > http://www.editplus.com
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >


        [Non-text portions of this message have been removed]
      • dz@caribe.net
        Won t remove whitespace surrounding strings within tags, but other than that its fine.-dZ.----- Original Message ----- From: Mark Kahn Sent: 5/19/2006
        Message 3 of 5 , May 19, 2006
        • 0 Attachment
          Won't remove whitespace surrounding strings within tags, but other than that its fine.

          -dZ.

          ----- Original Message -----
          From: Mark Kahn
          Sent: 5/19/2006 10:18:44 AM
          To: editplus@yahoogroups.com
          Subject: Re: [edit+] How can I delete html spaces

          > what's wrong with just
          >
          > find: >[\t \n]+<
          > replace: ><
          >
          > ?
          >
          > Also, if you need better regex support, I wrote a tool:
          >
          > http://editplus.info/wiki/User_Tools#Full_RegEx_Supported_Replace_and_More.21
          >
          > -Mark
          >
          > On 5/19/06, dz@... <dz@...> wrote:
          > >
          > > Let me get this straight, you want to remove all insignificant whitespace
          > > between HTML tags?
          > >
          > > If so, try this in EditPlus:
          > > Find what: (>)[ \t\n]+|[ \t\n]+(<)
          > > Replace with: \1\2
          > >
          > > [X] Regular expression
          > > [X] Current file
          > >
          > >
          > > Note that the "Find what:" line starts with the parenthesis-angled-backet,
          > > not whitespace. Also note that this will not remove whitespace within the
          > > tags themselves. For that you'll need to make another pass with a different
          > > regular expression. However, it is more difficult, as you need to take into
          > > consideration quoted strings and things like that, which EditPlus won't be
          > > able to do.
          > >
          > > -dZ.
          > >
          > > ----- Original Message -----
          > > From: josealberto1975
          > > Sent: 5/19/2006 8:40:27 AM
          > > To: editplus@yahoogroups.com
          > > Subject: [edit+] How can I delete html spaces
          > >
          > > > Hi, I have to delete all HTML spaces (with EditPlus or something).
          > > > It's too long for manual delete.
          > > >
          > > > From this:
          > > > --
          > > > <html>
          > > > <head>
          > > > </head>
          > > > <body>
          > > > <div>
          > > > <table>
          > > > <tr>
          > > > <td>
          > > > ...
          > > > </td>
          > > > </tr>
          > > > </table>
          > > > </div>
          > > > </body>
          > > > </html>
          > > >
          > > >
          > > > To this:
          > > > --
          > > > <html><head></head><body><div><table><tr><td>...</td></tr></table></div>
          > > > </body></html>
          > > >
          > > >
          > > > Regards,
          > > > J.A.
          > > >
          > > >
          > > >
          > > >
          > > >
          > > >
          > > >
          > > > http://www.editplus.com
          > > > Yahoo! Groups Links
          > > >
          > > >
          > > >
          > > >
          > > >
          > > >
          > >
          > >
          > >
          > >
          > > http://www.editplus.com
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          >
          > http://www.editplus.com
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
        • Richard Grevers
          On Sat, 20 May 2006 08:01:37 +1200, gave utterance to the ... which is a good thing, because attributes are delimited by whitespace and
          Message 4 of 5 , May 19, 2006
          • 0 Attachment
            On Sat, 20 May 2006 08:01:37 +1200, <dz@...> gave utterance to the
            following:

            > Won't remove whitespace surrounding strings within tags

            which is a good thing, because attributes are delimited by whitespace and
            presumably the goal is to still have working HTML.

            --
            Richard Grevers
            I'm lactose intolerant - I get really annoyed driving behind slow milk
            tankers
          • DZ-Jay
            ... No, I meant whitespace within open and close tags, as in: text I would imagine that he wanted that to be turned to: text dZ.
            Message 5 of 5 , May 19, 2006
            • 0 Attachment
              On May 19, 2006, at 17:39, Richard Grevers wrote:

              > On Sat, 20 May 2006 08:01:37 +1200, <dz@...> gave utterance to
              > the
              > following:
              >
              >> Won't remove whitespace surrounding strings within tags
              >
              > which is a good thing, because attributes are delimited by whitespace
              > and
              > presumably the goal is to still have working HTML.

              No, I meant whitespace within open and close tags, as in:
              <tag> text </tag>

              I would imagine that he wanted that to be turned to:
              <tag>text</tag>

              dZ.
            Your message has been successfully submitted and would be delivered to recipients shortly.