|laziness, impatience, and hubris|
New code wrap optionsby tye (Sage)
|on Aug 12, 2002 at 07:33 UTC||Need Help??|
While working on something else, I realized that I could make <code> tags automatically wrap code to (roughly) fit your window. So you can now go to user settings and check the "Auto Code Wrap" option and any stuff inside of <code> tags will be rendered such that your browser will wrap it to fit. So if the code is hard to read because it is wrapped too much, just widen your browser window.
If someone puts a really long string without spaces inside of <code> tags, then your browser won't wrap in the middle of this really long string. This is a pain, so if you have "Auto Code Wrap" checked and you also enter a number (say "20") in "Code Wrap Length" (leaving it blank doesn't default to "70" in this case), then we'll insert a red soft hyphen after each run of 20 non-space characters. These will be invisible (on a conforming browser) unless your browser decides to wrap the code at that point.
You can also now enter a "Code Prefix" which will be prepended to each line of code displayed. If you include
Note that "Code Wrapping Off" overrides all of these settings.
Also, if you have "Auto Code Wrap" checked (and no Code Prefix defined), you might be tempted to skip the "d/l code" link and just cut'n'paste the code directly. However, if you've entered a number for Code Wrap Length and that code has any strings of non-space characters that long or longer, then you'll get some soft hyphens included (even though they might be invisible) which will break the code.
I've tested things quite a bit but there were a lot of changes involved and some browsers may not like the red soft hyphens (if so, then either don't check Auto Code Wrap or set Code Wrap Length to be empty)...
If you'd like to test your new settings, try Re: Space or Soft Hyphens (see code wrap).- tye (but my friends call me "Tye")