diff --git a/src/dom/dom.js b/src/dom/dom.js index 813a5ae..48d255f 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -860,7 +860,44 @@ Element.Methods = { /** * Element.cleanWhitespace(@element) -> Element * - * Removes whitespace-only text node children from `element`. + * Removes all of `element`'s child text nodes that contain *only* + * whitespace. Returns `element`. + * + * This can be very useful when using standard methods like `nextSibling`, + * `previousSibling`, `firstChild` or `lastChild` to walk the DOM. Usually + * you'd only do that if you are interested in all of the DOM nodes, not + * just Elements (since if you just need to traverse the Elements in the + * DOM tree, you can use [[Element.up]], [[Element.down]], + * [[Element.next]], and [[Element.previous]] instead). + * + * #### Example + * + * Consider the following HTML snippet: + * + * language: html + *