private int ParseMarkup(out Element element, out EndTag trailingEnd)
        {
            trailingEnd = null;

            Match m;

            // commentMatcher MUST be checked before directiveMatcher!
            m = commentMatcher.Match(pos);
            if (m != null)
            {
                element = new Comment(data, pos, m.Length);
                return(m.Length);
            }

            // commentMatcher MUST be checked before directiveMatcher!
            m = directiveMatcher.Match(pos);
            if (m != null)
            {
                element = new MarkupDirective(data, pos, m.Length);
                return(m.Length);
            }

            m = endMatcher.Match(pos);
            if (m != null)
            {
                element = new EndTag(data, pos, m.Length, m.Groups[1].Value);
                return(m.Length);
            }

            m = beginMatcher.Match(pos);
            if (m != null)
            {
                return(ParseBeginTag(m, out element, out trailingEnd));
            }

            element = null;
            return(-1);
        }
        private int ParseMarkup(out Element element, out EndTag trailingEnd)
        {
            trailingEnd = null;

            Match m;

            // commentMatcher MUST be checked before directiveMatcher!
            m = commentMatcher.Match(pos);
            if (m != null)
            {
                element = new Comment(data, pos, m.Length);
                return m.Length;
            }

            // commentMatcher MUST be checked before directiveMatcher!
            m = directiveMatcher.Match(pos);
            if (m != null)
            {
                element = new MarkupDirective(data, pos, m.Length);
                return m.Length;
            }

            m = endMatcher.Match(pos);
            if (m != null)
            {
                element = new EndTag(data, pos, m.Length, m.Groups[1].Value);
                return m.Length;
            }

            m = beginMatcher.Match(pos);
            if (m != null)
            {
                return ParseBeginTag(m, out element, out trailingEnd);
            }

            element = null;
            return -1;
        }
 protected override void OnMarkupDirective(MarkupDirective markupDirective)
 {
 }
 protected override void OnMarkupDirective(MarkupDirective markupDirective)
 {
     if (FlagNotSet(Flag.RemoveMarkupDirectives))
         base.OnMarkupDirective(markupDirective);
 }
        protected override void OnMarkupDirective(MarkupDirective markupDirective)
        {
            if (markupDirective == null || _scriptDepth > 0)
                return;

            Emit(markupDirective.ToString());
            base.OnMarkupDirective(markupDirective);
        }
 protected virtual void OnMarkupDirective(MarkupDirective markupDirective)
 {
     DefaultAction(markupDirective);
 }