Allow non-formatting tokens to include newlines

Fixes #1151. Probably slightly faster too.