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", "form",
      "head", "html", "hr",
      "h1", "h2", "h3", "h4", "h5", "h6",
      "i", "img", "input",
      "label", "li",
      "meta",
      "object", "ol", "output",
      "p",
      "s", "script", "span", "strong", "style", "sub", "sup",
      "table", "textarea", "title", "td", "th", "tr",
      "ul",
   };

   // incomplete
   private final static String[] ATTRIBUTES = {
      "align", "alt",
      "bgcolor",
      "checked", "class",  "content", "cols",
      "for",
      "height", "href",
      "id",
      "name",
      "onclick",
      "rows",
      "src", "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);
   }
}

@@ -178,21 +178,32 @@
 , %22a
-rea%22, %22applet
+pplet%22, %22article%22, %22area
 %22,%0A 
@@ -313,24 +313,48 @@
  %22em%22,%0A     
+ %22figure%22, %22figcaption%22,
  %22font%22, %22fo
@@ -371,16 +371,26 @@
  %22head%22,
+ %22header%22,
  %22html%22,
@@ -498,11 +498,32 @@
   %22m
-eta
+ain%22, %22meta%22,%0A      %22nav
 %22,%0A 

add a few more tags for coloring