private void InsertNode(DomNode node) { // if the stack hasn't been set up yet, elements (doctype, comments) go into the doc if (stack.Count == 0) { doc.Append(node); } else if (IsFosterInserts()) { InsertInFosterParent(node); } else { CurrentElement.Append(node); } }
public void Insert(Token.Character characterToken) { DomNode node; // characters in script and style go in as datanodes, not text nodes if (CurrentElement.NodeName.In("script", "style")) { node = new HtmlText(characterToken.Data, true); } else { node = new HtmlText(characterToken.Data); } CurrentElement.Append(node); // doesn't use insertNode, because we don't foster these; and will always have a stack. }