Example #1
0
        private Dict _tag; /* tag's dictionary definition */

        #endregion Fields

        #region Constructors

        /*
        Mosaic handles inlines via a separate stack from other elements
        We duplicate this to recover from inline markup errors such as:

        <i>italic text
        <p>more italic text</b> normal text

        which for compatibility with Mosaic is mapped to:

        <i>italic text</i>
        <p><i>more italic text</i> normal text

        Note that any inline end tag pop's the effect of the current
        inline start tag, so that </b> pop's <i> in the above example.
        */
        public InlineStack()
        {
            _next = null;
            _tag = null;
            _element = null;
            _attributes = null;
        }
Example #2
0
 public Dict Add(Dict dict)
 {
     Dict d = (Dict)_tagHashtable[dict.Name];
     if (d != null)
     {
         d.Versions = dict.Versions;
         d.Model |= dict.Model;
         d.Parser = dict.Parser;
         d.CheckAttribs = dict.CheckAttribs;
         return d;
     }
     else
     {
         _tagHashtable[dict.Name] = dict;
         return dict;
     }
 }
Example #3
0
 public TagTable()
 {
     for (int i = 0; i < _tags.Length; i++)
     {
         Add(_tags[i]);
     }
     TagHtml = Lookup("html");
     TagHead = Lookup("head");
     TagBody = Lookup("body");
     TagFrameset = Lookup("frameset");
     TagFrame = Lookup("frame");
     TagNoframes = Lookup("noframes");
     TagMeta = Lookup("meta");
     TagTitle = Lookup("title");
     TagBase = Lookup("base");
     TagHr = Lookup("hr");
     TagPre = Lookup("pre");
     TagListing = Lookup("listing");
     TagH1 = Lookup("h1");
     TagH2 = Lookup("h2");
     TagP = Lookup("p");
     TagUl = Lookup("ul");
     TagOl = Lookup("ol");
     TagDir = Lookup("dir");
     TagLi = Lookup("li");
     TagDt = Lookup("dt");
     TagDd = Lookup("dd");
     TagDl = Lookup("dl");
     TagTd = Lookup("td");
     TagTh = Lookup("th");
     TagTr = Lookup("tr");
     TagCol = Lookup("col");
     TagBr = Lookup("br");
     TagA = Lookup("a");
     TagLink = Lookup("link");
     TagB = Lookup("b");
     TagI = Lookup("i");
     TagStrong = Lookup("strong");
     TagEm = Lookup("em");
     TagBig = Lookup("big");
     TagSmall = Lookup("small");
     TagParam = Lookup("param");
     TagOption = Lookup("option");
     TagOptgroup = Lookup("optgroup");
     TagImg = Lookup("img");
     TagMap = Lookup("map");
     TagArea = Lookup("area");
     TagNobr = Lookup("nobr");
     TagWbr = Lookup("wbr");
     TagFont = Lookup("font");
     TagSpacer = Lookup("spacer");
     TagLayer = Lookup("layer");
     TagCenter = Lookup("center");
     TagStyle = Lookup("style");
     TagScript = Lookup("script");
     TagNoscript = Lookup("noscript");
     tagTable = Lookup("table");
     TagCaption = Lookup("caption");
     TagForm = Lookup("form");
     TagTextarea = Lookup("textarea");
     TagBlockquote = Lookup("blockquote");
     TagApplet = Lookup("applet");
     TagObject = Lookup("object");
     TagDiv = Lookup("div");
     TagSpan = Lookup("span");
 }
Example #4
0
 public Node(short type, byte[] textarray, int start, int end)
 {
     _parent = null;
     _prev = null;
     _next = null;
     _last = null;
     _start = start;
     _end = end;
     _textarray = textarray;
     _type = type;
     _closed = false;
     _isimplicit = false;
     _linebreak = false;
     _was = null;
     _tag = null;
     _element = null;
     _attributes = null;
     _content = null;
 }
Example #5
0
 public static void CoerceNode(Lexer lexer, Node node, Dict tag)
 {
     Node tmp = lexer.InferredTag(tag.Name);
     Report.Warning(lexer, node, tmp, Report.OBSOLETE_ELEMENT);
     node.Was = node.Tag;
     node.Tag = tag;
     node.Type = StartTag;
     node.Isimplicit = true;
     node.Element = tag.Name;
 }
Example #6
0
 public Node(short type, byte[] textarray, int start, int end, string element, TagTable tt)
 {
     _parent = null;
     _prev = null;
     _next = null;
     _last = null;
     _start = start;
     _end = end;
     _textarray = textarray;
     _type = type;
     _closed = false;
     _isimplicit = false;
     _linebreak = false;
     _was = null;
     _tag = null;
     _element = element;
     _attributes = null;
     _content = null;
     if (type == StartTag || type == StartEndTag || type == EndTag)
     {
         tt.FindTag(this);
     }
 }
Example #7
0
        public virtual bool IsDescendantOf(Dict tag)
        {
            Node parent;

            for (parent = _parent; parent != null; parent = parent.Parent)
            {
                if (parent.Tag == tag)
                {
                    return true;
                }
            }

            return false;
        }