Your comments

This should be easy. But, I didn't think it would make a lot of sense for long source code files. I was probably wrong :)
Ok, that's easy. I'll be sure to register the .textile file extension for this.
I'll have a look. I'm already investigating Markdown support but that will probably require writing a different syntax highlighter.
Textastic now creates a file "file.php$$preview.html" so that the UIWebView interprets the file as html. It is deleted after the preview is loaded.

I tried various other ways to change the MIME type to "text/html", but then other things didn't work.

So the simple (but not so elegant) solution worked best.
As an alternative, this wouldn't happen when this features is implemented: http://feedback.textasticapp.com/feedback/7570-automatically-adjust-word-wrap-to-fit-screen/

The width of the text would always be less than (or equal to) the view width of the editor and so it wouldn't scroll sideways.