Menu

Easy way to trim unnecessary spaces etc

2007-03-19
2012-11-13
  • Nobody/Anonymous

    Hi there!

    I need to trim my HTML code to use among javascript so that I would get rid of unnecessary line breaks and spaces. I found no easy way of doing this. Is there a way to do it in Notepad++ with maybe a plugin or macro or something?

    Thank you for your help.
    -Tina

     
    • Nobody/Anonymous

      Thanks a lot! I'll check those out! :)

      -Tina

       
    • pshute

      pshute - 2007-03-20

      Plugins/TextFX Edit/Delete blank lines.

       
    • Nobody/Anonymous

      From the Macro menu, select "Trim Trailing and save" or press Alt-Shift-S.

      Regards
      Yoong

       
    • Nobody/Anonymous

      Hi, and thanks for replies!

      ..but I could not do it. :( I meant that when I replace <div> elements innerHTML with GetElementByID I need a html code that has no line breaks at all, or it will not work. :/ So I need to get rid of all of them! :E Aren't they all unnecessary when it comes to funtionality of html code? :)

      Sorry to bother you this much. I should have been more clear. :)
      -Tina

       
    • Nobody/Anonymous

      You might try the website - http://notepad-plus.sourceforge.net/uk/site.htm - and look at Peter Shute's article in the pop-out FAQ menu for "Newline find and replace FAQ" to get rid of the newlines.

      I'd suggest one line at a time starting with your <div> block, or you will be editing a file with one long line, a tedious endeavor.

      Another (remote) possibility is the HTMLTidy plugin found under the TextFX menu, although I don't know if one can use it to remove newlines.  --Joel