diff --git a/editor/base/nsEditor.cpp b/editor/base/nsEditor.cpp index d85b6a60706..cae3f7e4ca7 100644 --- a/editor/base/nsEditor.cpp +++ b/editor/base/nsEditor.cpp @@ -1033,6 +1033,15 @@ nsEditor::InsertFormattingForNode(nsIDOMNode* aNode) if (nodeType != nsIDOMNode::ELEMENT_NODE) return NS_OK; + // Insert formatting only for block nodes + // (would it be better to insert for any non-inline node?) + PRBool block; + res = IsNodeBlock(aNode, block); + if (NS_FAILED(res)) + return res; + if (!block) + return NS_OK; + nsCOMPtr parent; res = aNode->GetParentNode(getter_AddRefs(parent)); if (NS_FAILED(res)) diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index d85b6a60706..cae3f7e4ca7 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -1033,6 +1033,15 @@ nsEditor::InsertFormattingForNode(nsIDOMNode* aNode) if (nodeType != nsIDOMNode::ELEMENT_NODE) return NS_OK; + // Insert formatting only for block nodes + // (would it be better to insert for any non-inline node?) + PRBool block; + res = IsNodeBlock(aNode, block); + if (NS_FAILED(res)) + return res; + if (!block) + return NS_OK; + nsCOMPtr parent; res = aNode->GetParentNode(getter_AddRefs(parent)); if (NS_FAILED(res))