I like to use non-breaking spaces for that kind of thing, although they still might collapse that? At least it doesn't wrap non-breaking spaces.
Here is some preformatted text.
It might break up the flow of the text, but if something like whitespace is significant, that's probably a good thing.