replace newline instead of '\n'

Fix #830