public string GetCommentForCurrentPosition()
{
var sb = new StringBuilder();
int pos = CurrentPos;
int startPos = -1;
int endPos = -1;
string subText = Text.Substring(0, pos);
int startComment = subText.LastIndexOf("<!--");
if (startComment != -1)
{
string restOfFile = Text.Substring(startComment);
int endComment = restOfFile.IndexOf("-->");
if (endComment != -1)
sb.Append(restOfFile.Substring(4, endComment - 3));
else
sb.Append(restOfFile.Substring(4));
}
return sb.ToString();
}