Esempio n. 1
0
        /// <summary>Called when this node has been created and is being added to the given lexer.</summary>
        public override bool OnLexerAddNode(HtmlLexer lexer, int mode)
        {
            if (mode == HtmlTreeMode.InBody)
            {
                lexer.AddFormattingElement(this);
            }
            else
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        /// <summary>Called when this node has been created and is being added to the given lexer.</summary>
        public override bool OnLexerAddNode(HtmlLexer lexer, int mode)
        {
            if (mode == HtmlTreeMode.InBody)
            {
                Element node = lexer.FormattingCurrentlyOpen("a");

                if (node != null)
                {
                    // (parse error)
                    lexer.AdoptionAgencyAlgorithm("a");

                    lexer.CloseNode(node);
                    lexer.FormattingElements.Remove(node);
                }

                lexer.AddFormattingElement(this);
            }
            else
            {
                return(false);
            }

            return(true);
        }