Some AI models (such as DeepSeek V3/R1) sometimes generate unnecessary whitespace before newlines (they add spaces before newlines for some reason).
Would it be possible to filter this unnecessary whitespace automatically when using models that have a tendency to do this sort of stuff? It would be pretty easy to do with a simple regex replace.
The behavior could be like this:
" " -> " "
" \n" -> "\n"
" \n" -> "\n"