Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Setting NBBC config

jamesincjamesinc Sydney ✭✭
edited June 2017 in Vanilla 2.0 - 2.3

Hi all,

I use BBCode on my forums, and although NBBC supports stripping leading and trailing whitespace, it isn't enabled. So I wrote a very simple plugin to accomplish the task.

However, I now wonder if maybe it was configurable some other way and I've tried to be too clever about it?

I put the plugin online anyway: https://open.vanillaforums.com/addon/nbbcwhitespacetrim-plugin-1.0.0

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    There is no better way. In the __construct method, the two protected properties are initialized like that:

    $this->pre_trim = "";
    $this->post_trim = "";
    

    which means that by default there should be no trimming.

    Both properties can be changed with setPreTrim and setPostTrim and those setters are never used.

    1. They are initialized with a fixed value
    2. They are never touched afterwards

    => there is no other way than using some hook and the methods all by yourself like you did in your plugin.

Sign In or Register to comment.