account for newline in sourcemap prefix

thanks dellekappa.  fixes #17631

(cherry picked from commit 92d40ea7dd095e3e5a24c0ce929cbcaf6a961618)