예제 #1
0
        void TryProcessAspDelimiter()
        {
            var commentPosition = position + 1;
            var percentFound    = false;

            while (true)
            {
                c = NextChar();

                if (percentFound && c == '>')
                {
                    c = NextChar();

                    var aspDelimiter = new HtmlAspDelimiter()
                    {
                        Location = startTagLocation,
                        Slice    = new StringSlice(text, commentPosition, position - 3)
                    };
                    CurrentParent.AppendChild(aspDelimiter);
                    return;
                }

                percentFound = c == '%';

                if (c == '\0')
                {
                    Error($"Invalid EOF found while parsing comment");

                    AppendText(startTagLocation, position - 1);
                    return;
                }
            }
        }
예제 #2
0
        protected override void Write(HtmlAspDelimiter node)
        {
            if (ShouldPretty(node.Parent))
            {
                writer.WriteLine();
                this.WriteIndent();
            }

            base.Write(node);
        }
예제 #3
0
 protected virtual void Write(HtmlAspDelimiter node)
 {
     Write("<%");
     Write(node.Slice.ToString());
     Write("%>");
 }