| Author |
Message |
Scott tutorialtoday.com

Joined: 24 Mar 2005 Posts: 2593 Location: Mississauga, Ontario
|
|
| Back to top |
|
| |
ClickFanatic Est. 2005

Joined: 18 Jan 2005 Posts: 3877 Location: A particular geographic area
|
Posted: Thu Jan 31, 2008 7:11 am Post subject: |
|
|
That is because the function inserts one or more non-breaking-spaces ( ) for white-space characters (spaces and tabs) in the code.
These special characters will prevent the line from wrapping regardless of the CSS applied.
Here are your options:
- use CSS (overflow: auto;) to force scroll bars.
- use GeSHi for your syntax highlighting needs.
I would recommend the second option. GeSHi is very customisable and supports many more languages than just PHP. _________________ Captain Jell-O Buster from the Future
[img]http://feeds.feedburner.com/sparepencil.1.gif[/img] |
|
| Back to top |
|
| |
Scott tutorialtoday.com

Joined: 24 Mar 2005 Posts: 2593 Location: Mississauga, Ontario
|
|
| Back to top |
|
| |
krt ...

Joined: 11 Jan 2005 Posts: 4619 Location: Down Under
|
Posted: Thu Jan 31, 2008 6:32 pm Post subject: |
|
|
Good coding practice dictates line lengths should not be over a certain length anyway, e.g. 80 characters, but then, you probably won't be the only one writing the code to be submitted so either replace single with an actual space or use a more suitable highlighter.
I never really liked highlight_string() for anything beyond trivial tasks anyway, even though many issues with it have been fixed, and besides, it only applies to PHP code which is not very useful for a tutorials site that will probably have code in many other languages, at least HTML. |
|
| Back to top |
|
| |
|
|
|