void parseComment1(StreamReader stream, HtmlTextBlock textNode) { //注释忽略掉 string str = ""; while (!stream.EndOfStream) { char c = (char)stream.Read(); str += c; if (str.EndsWith("*/")) { textNode.Text = textNode.Text.Remove(textNode.Text.Length - 2, 2); break; } } }
void parseComment2(StreamReader stream, HtmlTextBlock textNode) { //注释忽略掉 string str = ""; while (!stream.EndOfStream) { char c = (char)stream.Read(); str += c; //textNode.Text += c; if (c == (char)10 || c == (char)13) { textNode.Text = textNode.Text.Remove(textNode.Text.Length - 2, 2); break; } } }