I was a little bit surprised to discover that this wasn't already catered for by the
fancyvrb package. When using that package, the problem would appear to be because the newline character is defined to be an outer macro, which can't then be gobbled into the verbatim command. So here's a little modification that defines a command
\VerbLB which converts newlines into spaces.
with+ a line break.
This produces "Some
text with a line break." (Given that the line break was inserted by your editor, my guess was that you didn't want it in the output). I've no idea if this breaks anything else! (Well, as it's a new macro it won't break anything, but I've no idea why the new line character was defined as
\outer and it may be that there was a very good reason for it.)
Incidentally, I was sorely tempted to comment "Use a better editor". Some editors use soft and hard line breaks and soft ones are only used for display purposes, thus removed when the file is written.