2012-12-19, 02:53 PM
Hi all! First post here.
I'm not sure if this is the proper place to post this, any moderator can feel free to move it if necessary.
I was having trouble with some z80 assembly code I was posting, because the forum would eat all tabulation spaces in the first line, so I checked the forum software name, came here, downloaded the source code, and looked for the way to fix it.
I suggested the webmaster to replace this line in
file class_parser.php (line 748 at version 1.6.09), in function mycode_parse_code:
with this one:
and it did fix the issue!
But testing if it worked, we found that if there's only one space, it doesn't show. This can be fixed adding in the same function, before the return line, the next line:
This replaces the case when there's only one space after a newline with a that always get shown by browsers.
Here's the problem in this very forum:
And an example after both patches have been applied (in spanish):
http://retrolandia.net/foro/showthread.p...224#pid224
I'm not sure if this is the proper place to post this, any moderator can feel free to move it if necessary.
I was having trouble with some z80 assembly code I was posting, because the forum would eat all tabulation spaces in the first line, so I checked the forum software name, came here, downloaded the source code, and looked for the way to fix it.
I suggested the webmaster to replace this line in
file class_parser.php (line 748 at version 1.6.09), in function mycode_parse_code:
$code = preg_replace('#^(\t*)(\n|\r|\0|\x0B| )*#', '\\1', $code);
with this one:
$code = preg_replace('#^(\t*)(\n|\r|\0|\x0B|)*#', '\\1', $code);
and it did fix the issue!
But testing if it worked, we found that if there's only one space, it doesn't show. This can be fixed adding in the same function, before the return line, the next line:
$code = str_replace("\n ", "\n ", $code);
This replaces the case when there's only one space after a newline with a that always get shown by browsers.
Here's the problem in this very forum:
5 spaces before text
1 space before text
And an example after both patches have been applied (in spanish):
http://retrolandia.net/foro/showthread.p...224#pid224