Handle newlines in route params.

Fix #3007.