Surface.Formatter.Phases.SpacesToNewlines (surface v0.7.0) View Source

In a variety of scenarios, converts :space nodes to :newline nodes.

(Below, "element" means an HTML element or a Surface component.)

  1. If an element contains other elements as children, surround it with newlines.
  2. If there is a space after an opening tag or before a closing tag, convert it to a newline.
  3. If there is a closing tag on its own line, ensure there's a newline before the next sibling node.

Link to this section Summary

Link to this section Functions

Callback implementation for Surface.Formatter.Phase.run/2.