Trim diagnostic messages to fix rendering bug (#4210)

Before this change a diagnostic message with a trailing newline (e.g.
`line1\nline2\n`) would be rendered in a `Block` with `line_height: 2`.
But the content we then display in this block had 3 "lines", which
pushed the content out of the block.

This fixes the issue by trimming the newlines at the end from the
diagnostics.

Release Notes:

- Fixed rendering multi-line diagnostic errors inside of the editor.
fc7458d13bThorsten Ball committed on 1/23/2024, 10:58:45 AM· committed by GitHubparentsaccb4f8f8939fd
1 file changedLine totals unavailable