PDA

View Full Version : pre tag in bbcode


VBCoder
06-17-2005, 05:48 AM
Is there any way for a user to use an equivalent to <pre> when putting in a message (eg via bbcode)?

If not, how can a user space out things when they type their message?

If there is no way, how would you create a mod to handle this?

Andreas
06-17-2005, 06:39 AM
ACP / Custom BB Codes / Add New BBCode
Title: PRE Tag
Replacement: <pre>{param}</pre>
Example: This has a lot spaces
Description: This Code allows you to use preformatted Text
Use {option}: No

VBCoder
06-17-2005, 01:47 PM
Thanks, Kirbs! Knew I could count on you.

One bug, though: If the user puts a newline within the [pre] tag, it will get converted into 2 newlines on display! vB turns newlines into newline<br />, and, since it is in pre mode, the browser shows the newline as well.

Andreas
06-18-2005, 01:35 AM
Not sure if it does work 100%, but you can try out the attached Plugin.
File functions_bbcodepre.php must be uploaded to directory includes.

VBCoder
06-19-2005, 05:11 AM
Excellent! Thanks, Kirbs - I'm trying to figure out the code. Could you explain briefly how it works?

mtha
09-21-2005, 04:43 AM
Not sure if it does work 100%, but you can try out the attached Plugin.
File functions_bbcodepre.php must be uploaded to directory includes.

Very nice Kirby.

1. Could you release this as a plugin?
2. while editting, if i switch Editor Mode back/forth many times, any break in the content get remove.

Hellmaster
01-30-2010, 07:31 AM
Did somebody fix this issue?? I tried to use PRE tag, but stills showing a new blank line... like he said https://vborg.vbsupport.ru/showpost.php?p=668313&postcount=3

I'm using 3.8.4