Exemplo n.º 1
0
        private bool ParseHtmlComment()
        {
            // Parse until the '-->'
            while (!EndOfFile)
            {
                AppendUntilAndParseCode(c => c == '-');
                if (CurrentCharacter == '-')
                {
                    Context.AcceptCurrent();

                    // Peek only needs to check for "->" because we've already seen the first '-'
                    if (Context.Peek("->", caseSensitive: true))
                    {
                        // End of the Comment
                        Context.AcceptUntilInclusive('>');
                        return(false);
                    }
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        private bool ParseCData()
        {
            // Parse until the ']]>'
            while (!EndOfFile)
            {
                AppendUntilAndParseCode(c => c == ']');
                if (CurrentCharacter == ']')
                {
                    Context.AcceptCurrent();
                    if (Context.Peek("]>", caseSensitive: true))
                    {
                        // End of the CData section
                        Context.AcceptUntilInclusive('>');

                        // Done parsing the CData
                        return(false);
                    }
                }
            }
            return(true);
        }