package eg.syntax;

/**
 * Syntax coloring for Html
 */
public class HtmlColoring implements Colorable {
   
   // incomplete
   private final static String[] TAGS = {
      "a", "area", "applet",
      "b", "blockquote", "body", "bold", "button", "br",
      "code", "col",
      "data", "div",
      "em",
      "font",
      "head", "html", "hr",
      "h1", "h2", "h3", "h4", "h5", "h6",
      "i", "img", "input",
      "li",
      "meta",
      "object", "ol",
      "p",
      "s", "script", "span", "style",
      "table",  "textarea", "title",
      "ul",
   };

   // incomplete
   private final static String[] ATTRIBUTES = {
      "align",
      "bgcolor",
      "class",  "cols", "content",
      "height", "href",
      "id",
      "name",
      "onclick",
      "rows",
      "scr", "source", "style",
      "title",  "type",
      "valign", "value",
      "width"
   };

   private final static String BLOCK_CMNT_START = "<!--";
   private final static String BLOCK_CMNT_END = "-->";
   private final JavascriptColoring jsCol = new JavascriptColoring();

   @Override
   public void color(SyntaxSearch search) {
      if (!search.isInBlock(BLOCK_CMNT_START, BLOCK_CMNT_END)) {
         search.setCharAttrBlack();
         search.htmlTags(TAGS, ATTRIBUTES);
         search.javascriptInHtml(jsCol);
      }
      search.blockComments(BLOCK_CMNT_START, BLOCK_CMNT_END);
   }
}

@@ -310,24 +310,32 @@
      %22font%22,
+ %22form%22,
 %0A      %22head
@@ -425,16 +425,25 @@
 %22,%0A     
+ %22label%22,
  %22li%22,%0A 
@@ -472,24 +472,34 @@
 ject%22, %22ol%22,
+ %22output%22,
 %0A      %22p%22,%0A
@@ -550,17 +550,16 @@
 %22table%22,
- 
  %22textar
@@ -719,24 +719,37 @@
  %22content%22,%0A
+      %22for%22,%0A
       %22heigh

add html tags and attributes to be colored