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; } } }
protected override void Write(HtmlAspDelimiter node) { if (ShouldPretty(node.Parent)) { writer.WriteLine(); this.WriteIndent(); } base.Write(node); }
protected virtual void Write(HtmlAspDelimiter node) { Write("<%"); Write(node.Slice.ToString()); Write("%>"); }