function transformChildren(node) {
    if (node.type !== 'link') return node;

    /**
     * Get the node's complete string value, check for leading and trailing
     * whitespace, and get nodes from each edge where whitespace is found.
     */
    const text = toString(node);
    const leadingWhitespaceNode = startsWith(text, ' ') && getEdgeTextChild(node);
    const trailingWhitespaceNode = endsWith(text, ' ') && getEdgeTextChild(node, true);

    if (!leadingWhitespaceNode && !trailingWhitespaceNode) return node;

    /**
     * Trim the edge nodes in place. Unified handles everything in a mutable
     * fashion, so it's often simpler to do the same when working with Unified
     * ASTs.
     */
    if (leadingWhitespaceNode) {
      leadingWhitespaceNode.value = trimStart(leadingWhitespaceNode.value);
    }

    if (trailingWhitespaceNode) {
      trailingWhitespaceNode.value = trimEnd(trailingWhitespaceNode.value);
    }

    /**
     * Create an array of nodes. The first and last child will either be `false`
     * or a text node. We filter out the false values before returning.
     */
    const nodes = [
      leadingWhitespaceNode && u('text', ' '),
      node,
      trailingWhitespaceNode && u('text', ' '),
    ];

    return nodes.filter(val => val);
  }
Run all children through the transform recursively.