Ejemplo n.º 1
0
 private HtmlNodeComment CreateHtmlNodeComment(HtmlReaderComment comment)
 {
     return new HtmlNodeComment
     {
         Index = _htmlNodeIndex++,
         Line = _disableLineColumn ? 0 : comment.Line,
         Column = _disableLineColumn ? 0 : comment.Column,
         Comment = comment.Comment.zReplaceControl()
     };
 }
Ejemplo n.º 2
0
        //private void ReadComment()
        private HtmlReaderComment ReadComment()
        {
            HtmlReaderComment comment = null;
            if (PeekChar() == '<' && PeekChar(1) == '!' && PeekChar(2) == '-' && PeekChar(3) == '-')
            {
                int line = _line;
                int column = _column;

                _stringBuilder.Remove(0, _stringBuilder.Length);
                while (true)
                {
                    GetChar();
                    if (_charInt == -1)
                        break;
                    _stringBuilder.Append(_char);
                    int l = _stringBuilder.Length;
                    if (l >= 3 && _stringBuilder[l - 3] == '-' && _stringBuilder[l - 2] == '-' && _stringBuilder[l - 1] == '>')
                        break;
                }
                //_isComment = true;

                string s = _stringBuilder.ToString();
                // pour supprimer <!-- et -->
                if (s.Length >= 7)
                    //_comment = s.Substring(4, s.Length - 7);
                    s = s.Substring(4, s.Length - 7);
                comment = new HtmlReaderComment { Line = line, Column = column, Comment = s };
            }
            return comment;
        }