res = LoadHTMLWithCharset(aQuotedText, aCharset);
res = LoadHTML(aQuotedText);
nsHTMLEditor::InsertAsCitedQuotation(const nsAReadableString & aQuotedText,                                     const nsAReadableString & aCitation,                                     PRBool aInsertHTML,                                     const nsAReadableString & aCharset,                                     nsIDOMNode **aNodeInserted){  nsCOMPtr<nsIDOMNode> newNode;  nsresult res = NS_OK;  // get selection  nsCOMPtr<nsISelection> selection;  res = GetSelection(getter_AddRefs(selection));  if (NS_FAILED(res)) return res;  if (!selection) return NS_ERROR_NULL_POINTER;  else  {    nsAutoEditBatch beginBatching(this);    nsAutoRules beginRulesSniffing(this, kOpInsertQuotation, nsIEditor::eNext);    // give rules a chance to handle or cancel    nsTextRulesInfo ruleInfo(nsTextEditRules::kInsertElement);    PRBool cancel, handled;    res = mRules->WillDoAction(selection, &ruleInfo, &cancel, &handled);    if (NS_FAILED(res)) return res;    if (cancel) return NS_OK; // rules canceled the operation    if (!handled)    {      res = DeleteSelectionAndCreateNode(NS_LITERAL_STRING("blockquote"), getter_AddRefs(newNode));      if (NS_FAILED(res)) return res;      if (!newNode) return NS_ERROR_NULL_POINTER;      // Try to set type=cite.  Ignore it if this fails.      nsCOMPtr<nsIDOMElement> newElement (do_QueryInterface(newNode));      if (newElement)      {        NS_NAMED_LITERAL_STRING(citestr, "cite");        newElement->SetAttribute(NS_LITERAL_STRING("type"), citestr);        if (aCitation.Length() > 0)          newElement->SetAttribute(citestr, aCitation);        // Set the selection inside the blockquote so aQuotedText will go there:        selection->Collapse(newNode, 0);      }      if (aInsertHTML)        res = LoadHTMLWithCharset(aQuotedText, aCharset);      else        res = InsertText(aQuotedText);  // XXX ignore charset      if (aNodeInserted)      {        if (NS_SUCCEEDED(res))        {          *aNodeInserted = newNode;          NS_IF_ADDREF(*aNodeInserted);        }      }    }  }  // Set the selection to just after the inserted node:  if (NS_SUCCEEDED(res) && newNode)  {    nsCOMPtr<nsIDOMNode> parent;    PRInt32 offset;    if (NS_SUCCEEDED(GetNodeLocation(newNode, address_of(parent), &offset)) && parent)      selection->Collapse(parent, offset+1);  }  return res;}