Jump to content

Code tag alternative that wraps

Featured Replies

Posted

Is there a [ code ] tag alternative that wraps?

If not, I suggest there be one! :-) Or a toggle-able option:
- Wrap code tags? Yes / No.

What do you mean by "wrap"? Do you mean one that auto-scrolls? If so, there is [ codebox ]

i guess he means like word wrap which will wrap a line after X word if theres a space.

Why not just quote it then :S

Use codebox. :)

By wrapping the code tag we would actually be breaking the code posted within it in a lot of cases, thus it's not realistic to do so. If you use codebox, a scrollbar is added which will prevent the page from stretching.

Use codebox. :)



By wrapping the code tag we would actually be breaking the code posted within it in a lot of cases, thus it's not realistic to do so. If you use codebox, a scrollbar is added which will prevent the page from stretching.



CodeBox processes the BB-Code! Is there a code-box like thing (with scrollbar) that does NOT process the bb-code?

CodeBox processes the BB-Code! Is there a code-box like thing (with scrollbar) that does NOT process the bb-code?


I love the PHP code boxes at codingforums example here, but alas, it is a vB forum.

what i don't get is why ipb doesn't support php tags, anyone wanna explain this?

It's a conspiracy.

i agree :D.

CodeBox processes the BB-Code! Is there a code-box like thing (with scrollbar) that does NOT process the bb-code?



Personally, I haven't tested this, but if codebox is processing bbcode, I'd report it as a bug. The purpose of the codebox (and code) is to be able to display code in a manner that isn't disrupted by actually parsing out html, bbcode, linebreaks, etc. If it is processing anything to be displayed as anything other than text, it's broken.
Codebox

<- bold text Egads, he's right.

blah blah blah

Code

[codebox][b]blah blah blah[/b] <- bold text
              Egads, he's right.
[/codebox]

It's because codebox is run on pre_display_parse, hence the bbcode is already parsed before the codebox bbcode is run on it - we know about the issue, but there's no easy immediate fix I'm afraid.

  • 10 months later...

I really really can't tell you how bad this is. I mean, it's really really bad. Since the upgrade to 2.3 I just put up with these anomalies, but they're now pushing me over the edge to change forum software. I've been with IPB since ver 1.x and it really beggers belief that I can put in a ticket and be told this problem can't be reproduced, yet below is evidence. If the guy that answered my ticket had even bothered to try it out here he would have found the bug(s)

$msg = sqlesc("You lost to $CURUSER[username] (You had $a[points] points, $CURUSER[username] had 21 points).\n\n - Play again");

CODE:

$msg = sqlesc("You lost to $CURUSER[username] (You had $a[points] points, $CURUSER[username] had 21 points).\n\n - [b][/b]"); :P :o :cool:


Play again



NOTE: 80x to nth gets ripped out, but apparently "computer says no". If you hover your mouse over the links you'll see showtopic is zero and pid is zero too! LoL

[topic="800"]uhuh[/topic]

[post="80000"]yep[/post]


uhuh
yep

I know of a simple way, just do it at the same time as the normal code tag. Btw, why did you guys even keep pre_display_parse if you are going to do this:

//class_post.php, method compile_post

'post'		=> $this->parser->pre_db_parse( $this->parser->pre_display_parse( $post ) ),



For the uneducated people, they finish all parsing before storing the final html in the database. So much for using two methods.
And seriously, don't bother with the "OMG LEGACY CRAP" story. Even if your engine does everything before the db, just move the full contents of pre_display_parse to pre_db_parse and make pre_display_parse just return the string.

And for v 3, I sincerely hope that you move the ipsclass style mangling of the input from the post making code into the parser. That is, send $_POST['Post'] to pre_db_parse and let the parser chose exactly what escaping to do and how. Sure, it may want to use the normal input escaping routine, but please, let it chose if it wants to.

And while I am ranting about this subject, please get rid of all the post formating code from anything but the parser class. I am talking about things like removing images for people who don't want them and a billion other tiny tasks. Treat the output from the parser as an unknown bit-stream, please. The only allowed things should be to dump the returned html out in the template and calling pre_edit_parse on the output of pre_db_parse to unparse the code.

The staff who saw my submission with my formating code replacement engine can probably relate to at least some of the stuff I've said.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.