Allow non-formatting tokens to include newlines

Fixes #1151.