![Sad :(](./images/smilies/icon_sad.gif)
Also, if there is such a thing, does it also create spaces between words when there's "too little" text on one line to fill it up completely (like two spaces instead of one between some words)?
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
No... it does what I want as long as I have TextPad open, but in my browser, it's still not word-wrapped with \ns.A bit iffy wrote:Is this what you want?
http://www.textpad.info/forum/viewtopic.php?t=6035
It doesn't. I serve text files as text filesben_josephs wrote:If your browser thinks that your file contains HTML it will treat newlines the same as spaces.
In what sense is the text not word-wrapped? Does it extend beyond the right margin of the browser?
Are there sufficient spaces in the text at which the lines can be broken?
Which browser are you using?
What is the file name extension?
How are you opening the file?
I don't have a single problem doing this embedded in HTML. The thing is that I provide the alternative for my users to read the text-file being embedded (user agreement) as pure text, and I'd PREFER if they saw it properly formatted.Jan Paul wrote:A long line is indeed shown as a long line in a browser.
I have found no "wrap" function in a browser until this time.
Do you use Unix style line breaks? There could be a problem too.
The fact that a browser can show text files is just a 'bonus'. It is not another way of showing textfiles with formatting. If you are very keen on keeping the formatting just right, use another program to format things (PDF/Word etc).
Are you just letting users see textfiles without changing the textfiles themselves? That way you never get formatting to work.
If they only need to see a formatted textfile, put an HTML envelope around the textfile and use replace to change the EOL into <BR>.
You can also do a change after the nth column into <BR>. Use a regular expression to do this. There are examples of this in this forum.
An automated tool could be PHP. Then you can read in the textfile, and after the nth position, put in the <BR>. Make it into a class and you can use it for every textfile. There are examples of this on the PHP website (www.php.net) and many others.
Regards,
Jan Paul