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
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.

add custom class VanillaHtmlFormatter

What would be the best way to add custom class VanillaHtmlFormatter in library/core/class.vanillahtmlformatter.php

Thks,

Comments

  • There seems to be a function "addExtraAllowedClasses" that you can use, I'm not entirely sure how to access the formatter in a plugin though...

    I suspect it has something to do with Gdn::factory("VanillaHTMLFormatter")? But that returns null...

  • @Caylus Thks, work perfect

            /**
             * @param Container $container
             */
            public function container_init_handler($container) {
                $container->get(VanillaHtmlFormatter::class)->addExtraAllowedClasses(['test']);
            }
    
    Caylusvrijvlinder
Sign In or Register to comment.