Menu

Globally Remove HTML Comments

MojoRyssen
2006-02-06
2012-11-13
  • MojoRyssen

    MojoRyssen - 2006-02-06

    am i able to remove "automatically", at once, ALL html comments from the currently active document?

    if not, then i think it would be a nice feature.
    why? because, upon my first evaluation of Notepad++ today, i realized what an INCREDIBLY USEFUL editor it is! it allowed me to clean-up a previously very "sloppy", complex, nested <ul><li> navigation menu, which has several sub menus, 5 levels deep-- it had been driving me nuts for several days-- and soemthing about Notepad++ (not even certain yet what it is...) just seemed to make it all seem less like a puzzle, and more like structured code that i could make logical sense of at a glance. i think it's due to the multiple visual guide options, such as "Show Whitespace and TAB" for example-- it really helped me to break it down, and cut out all of the "fat"-- (i.e. i was able to easily locate and remove all of the garbage white-space). at this point, i thought it would have been nice to remove all comments-- becaue i no longer needed them as "place holders".

    just a thought.

    thanks

     
    • Paulius

      Paulius - 2006-02-06

      Hello.

      Notepad++ is my favorite editor since about 2004... :)
      Anyway, as a programmer, i can not accept this feature!!! If Notepad++ ever implements the "Remove all coments from this document" feature - i will probably stop using it! That would be even worse then having Notepad++ to clear the read-only flag of a file. Think about it - as a programmer, i write comments to help people reading the code. I document the hard parts of the code. I also add the copyright notice at the top of each source file as a comment... And now, you press a single button and all those are gone! I realy don't think any of the dev's of Notepad++ will ever dare to implement something like that... ;)

       
      • Nobody/Anonymous

        What about if u write some code that is not open-source, maybe then u would like to remove all the comments

         
    • Marko Dumic

      Marko Dumic - 2006-02-06

      Hello,

      This is exactly what i need to do. But, as a programmer I also would not implement this "do this and that within any particular file format". Rather, I'd like to have few more features built into regular expression engine. For example, I would like this to work across multiple lines:
      <!--[.\s]*?-->
      Then, I'd just replace matches with empty string. Also, making list of favorite search expressions would be nice...
      Anyway, I am not able to make this work.
      Am I missing something?

      Btw. great application!
      Regards!

       
    • MojoRyssen

      MojoRyssen - 2006-02-06

      hehe... guess i never thought of HTML as "programming"-- for me, it's a structural markup for presentation-- i don't need those comments any longer once i've got the document how i want it.
      adding a few here and there for the consideration of anyone who might need to view and modify that code after i'm finished with it is a nice thought of course.

       
    • Chris Severance

      Chris Severance - 2006-02-06

      I never thought of HTML as a final document. The PHP that generates the comment free HTML is where my comments are.

      >Also, making list of favorite search expressions would be nice

      The Ctrl+R dialog will (eventually) allow you to save your RegEx searches.

      >I would like this to work across multiple lines

      Scintilla doesn't support multi-line RegEx and a clever non RegEx way to do this isn't coming to mind. Scintilla also doesn't sport a 'greedy' modifier. Your search would necessairly be non greedy.

       
    • MojoRyssen

      MojoRyssen - 2006-02-07

      having never used an editor quite like this before; an editor imbibed with features specificly enhanced to delight our genuine coders' taste in an IDE, rather than the needs specific to 'web designers' who seek HTML and CSS productivity enhancements, i hadn't considered how i might need to take a new approach to my own development needs versus the abundant, powerful tools of this particular IDE-- meaning, rather than think of features such as "remove HTML comments", instead, i should ask myself: "how can i make this tool work for me?".

      My own expertise in Regular Expressions, multiple coding languages, etc., it would seem is truly where the deficiency lies-- not in the features of N++. In the short time i've spent with it, i understand that certainly Notepad++ wasn't designed with kids in mind, and realizing why it wouldn't be desireable to over-bloat it with features that it doesn't need, i must consider what _I_ need to learn in order to take more full advantage of the power it offers its users. Having this power graciously offered for FREE nonetheless, is inspiration enough to go back a learn as much as i can about Regular Expressions, and other code editing techniques / skills which will help me to realize not only the potential of N++, but my own potential as well.

      wow! all that from a 'Free' tool i might never have looked at had it not been suggested that it "makes for a nice source viewer to enhance the Web Dev qualities of FireFox"!! amazing indeed!

      thanks, Notepad++, for the inspiration-- it will go a long way!

       
      • Don HO

        Don HO - 2006-02-11

        > wow! all that from a 'Free' tool i might never have looked at had
        > it not been suggested that it "makes for a nice source viewer to enhance the Web Dev qualities of FireFox"!! amazing indeed!

        Take a look at :
        http://notepad-plus.sourceforge.net/uk/about.php
        Notepad++ is a free source code editor which supports several programming languages running under the MS Windows environment.

        also at :
        http://sourceforge.net/projects/notepad-plus/
        Notepad++ is a generic source editor (it tries to be anyway) and Notepad replacement written in C++ with the win32 API

        Don

         
      • Paulius

        Paulius - 2006-02-07

        > hehe... guess i never thought of HTML as "programming"
        Sorry, i used a wrong word here -it should have been "coding".

        > wow! all that from a 'Free' tool i might never have looked at had
        > it not been suggested that it "makes for a nice source viewer to
        > enhance the Web Dev qualities of FireFox"!! amazing indeed!
        Can you tell us who and where was Notepad++ suggested?
        I find it very interesting... :)

         
    • Chris Severance

      Chris Severance - 2006-02-07

      >My own expertise in Regular Expressions, multiple coding languages

      The TextFX plugin source has an HTML parser which could easily be modified to remove comments.

      >i must consider what _I_ need to learn in order to take more full advantage of the power it offers its users

      Sarcasm or not, Notepad++ didn't do what I wanted either so I wrote TextFX to do what I wanted.