package eg.syntax;

/**
 * Syntax highlighting for Html
 */
public class HTMLHighlighter implements Highlighter {

   /**
    * The array of HTML tags
    */
   public final static String[] TAGS = {
      "a", "abbr", "address", "applet", "area", "article", "aside", "audio",
      "b", "base", "bdi", "bdo", "blockquote", "bold", "body", "br", "button",
      "canvas", "caption", "code", "col", "colgroup", "command",
      "data", "details", "datalist", "dd", "del", "dfn", "div", "dl", "dt",
      "em", "embed",
      "fieldset", "figure", "figcaption", "form", "footer", "frame", "frameset",
      "head", "header", "html", "hr",
      "h1", "h2", "h3", "h4", "h5", "h6",
      "i", "iframe", "img", "input", "ins",
      "kbd", "keygen",
      "label", "legend", "li", "link",
      "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter",
      "nav", "noframes", "noscript",
      "object", "ol", "optgroup", "option", "output",
      "p", "param", "pre", "progress",
      "rp", "rt", "ruby",
      "s", "samp", "script", "section", "select", "small", "source", "span", "strong",
      "style", "sub", "summary", "sup", "svg",
      "table", "tbody", "textarea", "tfoot", "thead", "time", "title", "td", "th", "tr",
      "track",
      "ul",
      "video",
      "wbr",
   };

   private final static String[] ATTRIBUTES = {
      "accesskey", "abbr", "accept", "accept-charset", "action", "align", "alt",
      "archive", "axis",
      "bgcolor", "border",
      "callpadding", "callspacing", "char", "charset", "checked", "cite", "class",
      "classid", "code", "codebase", "codetag", "compact", "content", "coords", "cols",
      "colspan",
      "data", "datetime", "declare", "defer", "dir", "disabled",
      "enctype",
      "for", "frame", "frameborder",
      "headers", "height", "href", "hreflang", "hspace", "http-equiv",
      "id", "ismap",
      "label", "longdesc",
      "marginheight", "marginwidth", "maxlength", "media", "method", "multiple",
      "name", "nohref", "noresize", "noshade",
      "onclick", "onload",
      "profile",
      "readonly", "rel", "rev", "rows", "rowspan", "rules",
      "scheme", "scope", "scrolling", "selected", "size", "shape", "src", "source",
      "standby", "start", "style", "summary",
      "tabindex", "target", "title",  "type",
      "usemap",
      "valign", "value", "valuetype", "vspace",
      "width",
      "xml:lang", "xml:space", "xmlns",
   };

   private final static String BLOCK_CMNT_START = "<!--";
   private final static String BLOCK_CMNT_END = "-->";
   private final JavascriptHighlighter js = new JavascriptHighlighter();
   private final CSSHighlighter css = new CSSHighlighter();

   @Override
   public void highlight(SyntaxHighlighter.SyntaxSearcher searcher) {
      if (!searcher.isInBlock(BLOCK_CMNT_START, BLOCK_CMNT_END)) {
         searcher.setCharAttrBlack();
         searcher.htmlTags(TAGS, ATTRIBUTES);
         searcher.embedInHtml(js, "<script", "</script>");
         searcher.embedInHtml(css, "<style>", "</style>");
      }
      searcher.blockComments(BLOCK_CMNT_START, BLOCK_CMNT_END);
   }
}

@@ -1083,16 +1083,22 @@
  %22span%22,
+%0A     
  %22strong
@@ -1099,22 +1099,16 @@
 strong%22,
-%0A     
  %22style%22
@@ -1217,16 +1217,22 @@
 %22, %22td%22,
+%0A     
  %22th%22, %22
@@ -1235,22 +1235,16 @@
 %22, %22tr%22,
-%0A     
  %22track%22
@@ -1283,33 +1283,32 @@
    %22wbr%22,%0A   %7D;%0A
-%0A
    private final
@@ -1638,16 +1638,22 @@
 ds%22,
+%0A     
  %22cols%22,
 %0A   
@@ -1648,22 +1648,16 @@
  %22cols%22,
-%0A     
  %22colspa
@@ -2431,17 +2431,16 @@
 ,%0A   %7D;%0A
-%0A
    priva
@@ -2544,16 +2544,17 @@
  %22--%3E%22;%0A
+%0A
    priva
@@ -2940,19 +2940,18 @@
 mbed
+ded
 InHtml(
-js, 
 %22%3Csc
@@ -2968,16 +2968,20 @@
 script%3E%22
+, js
 );%0A     
@@ -3002,20 +3002,18 @@
 mbed
+ded
 InHtml(
-css, 
 %22%3Cst
@@ -3029,16 +3029,21 @@
 /style%3E%22
+, css
 );%0A     

make textual changes