What I'd try is to change the newline character from category 5 (end of line)
to category 10 (space).
So try:
\catcode char10=10
\catcode char13=10