Example #1
0
        /// <summary>Called when a close tag of this element has
        /// been created and is being added to the given lexer.</summary>
        /// <returns>True if this element handled itself.</returns>
        public override bool OnLexerCloseNode(HtmlLexer lexer, int mode)
        {
            if (mode == HtmlTreeMode.InBody)
            {
                lexer.AdoptionAgencyAlgorithm("a");
            }
            else
            {
                return(false);
            }

            return(true);
        }
Example #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);
        }
Example #3
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.ReconstructFormatting();

                if (lexer.IsInScope("nobr"))
                {
                    // (Parse error)
                    lexer.AdoptionAgencyAlgorithm("nobr");

                    lexer.ReconstructFormatting();
                }

                lexer.Push(this, true);
                lexer.AddFormatting(this);
            }
            else
            {
                return(false);
            }

            return(true);
        }