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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 11:46 Go to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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 11: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
add to buddy list
ignore all messages by this user
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 12:49 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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 12: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
add to buddy list
ignore all messages by this user
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 13:56 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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 14: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
add to buddy list
ignore all messages by this user
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] Wed, 03 December 2003 19: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
add to buddy list
ignore all messages by this user
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 05: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
add to buddy list
ignore all messages by this user
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 05: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 06:24 Go to previous message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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."
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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 Oct 23 18:47:00 EDT 2017

Total time taken to generate the page: 0.00933 seconds