fixes #1917
Fix leading/trailing whitespace in code blocks disappearing
Partial #1912 fix