View Full Version : State of post when parsed by BBCode?
MrApples
01-24-2008, 11:03 PM
If I were to add a custom BBCode through the appropriate plugin, would the code be in HTML when it reached that function? Or would it still be in BBCode.
Specifically I need to know if <br />'s have been added. THank you in advance.
Eikinskjaldi
01-25-2008, 02:55 AM
An odd question. Are you thinking vb does something magical where the post goes from no html to all html in the twinkling of an atomic eye?
the bbcode parser is stack based, and it moves through the post replacing bbcode with html as it goes. Whether there would be any html by the time it reaches your custom code depends on where in the post your custom tag is.
MrApples
01-25-2008, 05:09 PM
I am not referring to it replacing BBCode with HTML, but newline and long spaces( and quotes too I think) - are they replaced with HTML?
And of course I know it doesn't magically do that... "when it reached that function".
"<br />" and " " - how are they handled?
I'm building a parser for a different coding language which isn't tag-based.
Opserty
01-26-2008, 12:13 PM
vBulletin probably makes use the PHP nl2br() (http://php.net/nl2br) function, although I'm not 100% sure. You could just search the class_bbcode.php file for nl2br and see if you get any hits. For things like coding languages though, you will want to split off the code so that the newlines are not converted into Line Breaks and instead make use of the HTML <pre> tag.
MrApples
01-27-2008, 02:07 AM
Ok thank you.
It looks like that is used.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.