コード例 #1
0
ファイル: HtmlParser.cs プロジェクト: vini-cesar/NUglify
        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
ファイル: HtmlWriterBase.cs プロジェクト: vini-cesar/NUglify
 protected virtual void Write(HtmlAspDelimiter node)
 {
     Write("<%");
     Write(node.Slice.ToString());
     Write("%>");
 }