Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 07:30 am EST

Geeklog Forums

html quoting problem???


Status: offline

robinbowes

Forum User
Junior
Registered: 08/06/02
Posts: 23
Hi,I've just posted a comment over on the "Help" section in which I tried to do HTML-formatted using the <code> tag to quote my code. However, it wouldn't display correctly because of some quote characters in the code fragment.Here's the article - see my comment in response to sardu's second comment.Here's the php code I was trying to quote:$display .= '</td><td><img src=' . $_CONF['site_url'] . '/images/speck.gif" height="1" width="10"></td>' . LB. '<td valign="top" width="180">' . LB . COM_showBlocks('right',$topic). '<br><img src="' . $_CONF['site_url'] . '/images/speck.gif" width="180" height="1">' . LB;Is this a bug in geeklog's handling of html, or more specifically, a failure to deal with embedded quote characters?R>
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Sorry, I don't understand what the problem is, but if you want to reproduce pieces of code (HTML or PHP) verbatim, you should use Geeklog's
Text Formatted Code
 ...
tags, not the HTML <code> tag. bye, Dirk
 Quote

Anonymous

Anonymous
Is this supposed to work also when quoting Perl snippets? I couldn't see why not, but when I tried, it doesn't. It's displaying the code in monospaced font and seem to strip off the linefeeds. Thanks, selk
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
It should work for anything, actually. Can you give an example? bye, Dirk
 Quote

Anonymous

Anonymous
OK, I think I just got it. Just this simple code:
Text Formatted Code

sub myfunc {
    my ($self, $args) = @_;

    # do my stuff here

    return 1;
}
 
works OK if entered in comments, but not if it's the original story, i.e., introtext or bodytext. Thanks, selk
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Hmm, works for me ... bye, Dirk
 Quote

Status: offline

rv8

Forum User
Regular Poster
Registered: 10/10/02
Posts: 105
Location:Ottawa, Canada
Perhaps the behaviour is different depending on whether you are in "Plain Old Text" mode vs "HTML Formatted" mode.---Kevin
Kevin Horton
 Quote

Anonymous

Anonymous
OK I give up. I verified and it does work here. The only difference is that I am on 1.3.7 while this site is 1.3.7sr1, although I diff submit.php and there is no difference between the two versions. I'll try upgrading to 1.3.7sr1 tonight and see what happens. Thanks for your time, Dirk. BTW, I have to turn on HTML mode for this, right? Because otherwise [code ] will not be rendered as it should be. selk
 Quote

Anonymous

Anonymous
Hi Dirk, OK, I got it! In lib-common.php, I have to comment out the line:
Text Formatted Code

function COM_checkHTML( $str )    
{
    global $_CONF;

    $str = stripslashes($str);

    // Get rid of any newline characters
//********** I have to comment out the line below **********
//    $str = preg_replace( "/n/", '', $str );

 
I don't know what are the other consequences for doing this. This is now on 1.3.7sr1. It seems like what you have here has this line already commented out, perhaps(?) Why is it different than the released version then? Thanks, selk
 Quote

All times are EST. The time is now 07:30 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content