code /php display borked in RC 9 [message #15130] |
Wed, 03 December 2003 16:46 |
Olliver
Messages: 443 Registered: March 2002
Karma: 0
|
Senior Member |
|
|
Hello,
as the headline says there's an issue affecting both php and code tags:
If some code is displayed by one of these tags, RC9 will add an additional newline for each newline. This is very annoying when it comes to larger code blocks
Demonstration:
// avoid trails of query strings which aren't relevant for page counting
function filter_uri() {
$uri = (!empty($_SERVER["URL"]) ? $this->clean($_SERVER["URL"]) : $this->clean($_SERVER["REQUEST_URI"]));
$uri = (strstr($uri, "://") ? "/" : $uri);
$autoparts = explode("/", str_replace("//", "/", $uri));
if (isset($uri)) unset($uri);
$uri = "/";
for ($i = 0, $max = count($autoparts); $i < $max; ++$i) {
$match = strpos(($trimmed = trim($autoparts[$i])), "?");
if ($match === 0) break;
else $trimmed = ($match ? substr($trimmed, 0, $match) : $trimmed);
if (realpath($trimmed)) {
$test = explode(".", $trimmed);
$first = strtolower(trim($test[0]));
$uri .= (((count($test) === 2) && ($first == "index") || ($first == "default")) ? "" : $trimmed);
break;
}
elseif ($trimmed === "") continue;
else $uri .= $trimmed."/";
}
return $uri;
}
(snippet by BBClone, Gnu/GPL)
Expected result would be code just like the <pre> tag in HTML would generate.
On another node, I find the light green background for code plain ugly, it doesn't fit very well to the rest of the default layout. Maybe it would be wiser to use a similiar background color as for quotes.
Olliver
|
|
|
|
Re: code /php display borked in RC 9 [message #15133 is a reply to message #15131] |
Wed, 03 December 2003 17:49 |
Olliver
Messages: 443 Registered: March 2002
Karma: 0
|
Senior Member |
|
|
Ok, sorry if this was old news to you, but I didn't find any reports so I thought no one has stumbled over it yet.
Regarding the background, I'd suggest the same color you use for quoting. Maybe even a similiar presentation (although this may lead to reproaches of copying phpBB which use that style for the "code" attribute)
Which files need to be replaced for having this issue fixed?
Olliver
|
|
|
Re: code /php display borked in RC 9 [message #15134 is a reply to message #15133] |
Wed, 03 December 2003 17:55 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
post_proc.inc.t needs to be replaced.
I'd prefer to avoid using the same color for code & quote to allow easy visual differentiation between the two. That said, if no better suggestions are made I'll probably make it use the same color as the one used for quote.
FUDforum Core Developer
|
|
|
|
|
|
Re: code /php display borked in RC 9 [message #15156 is a reply to message #15130] |
Thu, 04 December 2003 10:26 |
bobmurphy
Messages: 166 Registered: November 2003 Location: ireland
Karma: 0
|
Senior Member |
|
|
Quote: |
if you use the same color (which I think might work), just set it to use the dashed lines around the box. that would differentiate.
|
my tuppence worth is that i agree with the dashed line idea - but i would add a very small sized bit of text saying Code: in the same place as you have the Quote: positioned in the quote display in this message.
also wouldn't italic text differentiate it further -- a person would hardly need to italicise parts of their code that baddly would they ??
i also just thought that a slight change in the text color or font might be another alternative
[Updated on: Thu, 04 December 2003 10:30] Report message to a moderator
|
|
|
Re: code /php display borked in RC 9 [message #15157 is a reply to message #15156] |
Thu, 04 December 2003 11:24 |
|
esm2002
Messages: 339 Registered: May 2002 Location: Atlanta Georgia
Karma: 0
|
Senior Member |
|
|
i think the idea is for the text inside the CODE tag to be unformatted in any way. I think that is the way it should remain. if you want to format text inside the tag, use the QUOTE tag instead.
I do like the idea of using the word CODE: to identify it as such.
Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
|
|
|