public void StartElement(HtmlNode node)
        {
            labelStacks.AddItem(null);
            TagAction ta = tagActions.Get(node.Name);

            if (ta != null)
            {
                if (ta.ChangesTagLevel())
                {
                    tagLevel++;
                }
                flush = ta.Start(this, node.Name, node.Attributes) | flush;
            }
            else
            {
                tagLevel++;
                flush = true;
            }
            lastEvent    = NBoilerpipeContentHandler.Event.START_TAG;
            lastStartTag = node.Name;
        }
        public void EndElement(HtmlNode node)
        {
            TagAction ta = tagActions.Get(node.Name);

            if (ta != null)
            {
                flush = ta.End(this, node.Name) | flush;
            }
            else
            {
                flush = true;
            }
            if (ta == null || ta.ChangesTagLevel())
            {
                tagLevel--;
            }
            if (flush)
            {
                FlushBlock();
            }
            lastEvent  = NBoilerpipeContentHandler.Event.END_TAG;
            lastEndTag = node.Name;
            labelStacks.RemoveLast();
        }
Beispiel #3
0
 public bool ChangesTagLevel()
 {
     return(t1.ChangesTagLevel() || t2.ChangesTagLevel());
 }