Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Extension: BBCodeParser

2»

Comments

  • That's right bjrn. I believe that is what the result should be, so I'm looking at how to get that and how SirNot's recursive (R) can help me :)
  • Well then you get into trying to determine what is code and what isn't. Suppose they had this in their code tags: printf("</code>");? It's not a nested code tag pair, but it also isn't the end of the code.

    I'd rather keep it (the html formatter) simple and not try to second guess the poster.
  • I complete agree SirNot, but then how do you present that code?

    In the case of BBCode, I suppose you can always do it in the HTML formatter and vice-versa...
  • Is there a way to make this a bit more user friendly? Eg always presume there's going to be bbcode inside the post, rather than making a person click "bbcode" under the post box.. and/or, also, when the bbcode gets processed, make it so the linebreaks are NOT stripped out? Would make a lot more sense imo.. or if someone can just point me in the right direction on how to do this to mine, it'd be greatly appreciated.. as i'd rather every post was processed as having bbcode but linebreaks are not stripped out.
  • Ok the only thing I need now, if someone can help me, is to make linebreaks still work when the post is parsed as bbcode. Rather than making users have to put [br] for each new line etc. Is this possible? It's the only thing stopping me from making my site live right now. I don't want to have to explain to users why they have to use [br] tags if they want to do something as simple as post a link. I've got the forum automatically parsing every post as bbcode, which works fine.. just the linebreak bit needs fixing.
  • There is an option to make BBCode the default, but I haven't included it so far. When I get around to making a settings screen for this extension I'll pop it in there so you can simply toggle it on and off. Try adding this:// set the default formatter to BBCode $Context->Configuration['DEFAULT_FORMAT_TYPE'] = 'BBCode';
    above/before line 13:class AutoPFormatter extends StringFormatter {
    Regarding the line break stripping, that is just a function of this version of the parser. BBCodeParser strips everything out and pretty much all the other formatters whack extra ones in all over the place, so that's why AutoP exists. Install and enable AutoP and see if that makes things better for you.
  • That AutoP extension worked perfectly! Thank you heaps.. I think everything is pretty much how I like it now.. cheers :)
  • You're welcome, glad to be of service :)

    Regarding the whole default formatter thing, do people think it would be rude to have the formatter default itself by default? What happens when you have two formatters that do the same thing?

    Let me know, thanks :)
  • Hi!
    When it comes to tags inside a code block, that's even more problematic, isn't it?
    This is a second problem. But no for me, because nobody is posting code inside my forums. ;-)

    Solving the nested quote problem would be enough for me, and perhabs for many others too?

    Posting code is a more sophistcated problem, because of all the nice things we like to have for code: line numbers, syntax hightligthning, nice breaks... perhabs this should be handled by a diffrent extension?

    Bye
    Tiggr
  • I'm looking at the nested quotes first and the code second.
  • FYI, I have the same problem wit BBCodeParser (empty page). Adding AutoP did not solve it.
    As soon as I activate BBCP I get a black page. AutoP alone has no such problems.

    That said, I get the *feeling* that activating AutoP significantly slowed down the forums.
    Anyone else experiencing this, or is this a figment of my imagination?
  • Tom, do you know if your host has PEAR installed?
  • TomTesterTomTester New
    edited March 2007
    No I do not know, but it could be my own responsibility (recently switched to a semi-
    managed VPS solution and I've encountered that many things I took for grated are
    not installed). Will check, install and/or report.
  • Hi. Just wondering how things are going with this extension (no demanding, just wondering). Any progress on the nested quotes? :)
  • StashStash
    edited March 2007
    In fact, yes. I keep meaning to put it all back together again and release - works just been a bit demanding recently. I've also added a few more tags such as [left] [right] [center] [acronym] and got some autolinking cases that were breaking fixed. Thanks for the nudge, I'll see if I can make a release ASAP.

    PLEASE NOTE that as of 2007-03-17 I won't be looking in here for problems any longer. Please use the official BBCodeParser discussion for all future requests. Everything put in here will be ignored.

    Would an admin mind closing this discussion?
  • Neato! Thanks for continuing to work on it. :)
This discussion has been closed.