FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » code /php display borked in RC 9
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
code /php display borked in RC 9 [message #15130] Wed, 03 December 2003 16:46 Go to next message
Olliver   Germany
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 #15131 is a reply to message #15130] Wed, 03 December 2003 16:50 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Already fixed in CVS.

I used the green background to make it standout, but I am open to suggestions for better colors Smile.


FUDforum Core Developer
Re: code /php display borked in RC 9 [message #15133 is a reply to message #15131] Wed, 03 December 2003 17:49 Go to previous messageGo to next message
Olliver   Germany
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #15136 is a reply to message #15134] Wed, 03 December 2003 18:56 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
I understand your preference. principally it either ought to be lighter or darker than the message body. maybe the darker grey used for the background of the message header (and footer) could serve that purpose. then you could both distinguish quotes from code and point it out (though I liked the old style without background, since it also was a nice equivalent for the <pre> tag, for which a FUD tag doesn't exist)

thanks for the filename Smile

Olliver
Re: code /php display borked in RC 9 [message #15137 is a reply to message #15136] Wed, 03 December 2003 19:07 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The old style of <pre> is probably going to be re-implemented as another tag. Probably with a creative name like [pre] Wink

I actually tried the darker color (used in header/footer) originally and it didn't look nice and actually was confusing. I believe we definately need a distict color for the [code] tag, I am just not sure what it could be.


FUDforum Core Developer
Re: code /php display borked in RC 9 [message #15149 is a reply to message #15134] Thu, 04 December 2003 00:28 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
Ilia wrote on Wed, 03 December 2003 12:55


...I'll probably make it use the same color as the one used for 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.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: code /php display borked in RC 9 [message #15156 is a reply to message #15130] Thu, 04 December 2003 10:26 Go to previous messageGo to next message
bobmurphy is currently offline  bobmurphy   Ireland
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 ?? Cool

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 Go to previous message
esm2002 is currently offline  esm2002   United States
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."
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mysterious Problems
Next Topic: v2.6.0RC9 double spaces in replies
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 19:04:18 GMT 2024

Total time taken to generate the page: 0.02420 seconds