Menu

Automatic HTML syntax check

kasperbs
2009-04-24
2012-11-13
  • kasperbs

    kasperbs - 2009-04-24

    Is there a way to have Notepad++ to warn you when you make a syntax error? For example let say I open the <body> tag but forget to close it.

     
    • cchris

      cchris - 2009-05-04

      Check the wiki for an example HTML Tidy script. I don't know much beyond that, so you'd probably need to go to Tidy's website and look for reference material on configuring the checker.

      CChris

       
    • cchris

      cchris - 2009-04-25

      TextFx -> TextFX HTML Tag -> Tidy (most recent HTMLTIDY.CFG)

      You get a <instal dir>\plugins\config\tidy\HTMLTIDY.ERR plain text file, and your document is corrected.

      CChris

       
      • kasperbs

        kasperbs - 2009-04-28

        Thanks, only problem is that it's also correcting the HTML for me. Even if I just highlight a selection, it still inserts stuff like </body> and </html> at the end. I simply need something that will tell me that I'm wrong, not correct it. I sometimes use PHP includes which do not need either <body> or <html> tags.

        But the most important thing would be pure formatting. Is there a way to simply format a document with auto indents with out completing syntax mistakes?

         
    • cchris

      cchris - 2009-04-28

      You can instuct HTML Tidy to do what you want (no correction and formatting) using its .cfg file. You'll have to check the HTML Tidy website for the proper mix of options to put in tidy.cfg.

      I also noticed a TextFX -> Convert -> Submit to W3C HTML validator entry. But that may not be what you want, from your last post.

      CChris

       
      • kasperbs

        kasperbs - 2009-05-03

        Thanks I will def. have to check that out. That is exactly what I was looking for. Once I know the syntax it should make customization pretty easy.