BUG in Input Formatter - extra formatting cycles.

2»

Comments

  • true
  • You don't even have to use the conditional. The Discussion or Comment will be in
    $Sender->EventArguments['Object'] regardless of what type it is.
    So the pre-processing should be
    $Sender->EventArguments['Object']->Body = ParseSyntax($Sender->EventArguments['Object']->Body);

    Cool.
  • x00x00 MVP
    edited November 2011
    or

    $Args['Object'] with the second parameter being $Args

  • edited November 2011
    better decision than to handle all events :

    <?php if (!defined('APPLICATION')) exit(); $PluginInfo['PlainFormatter'] = array( 'Name' => 'Plain Formatter PLUGIN', 'Description' => 'Very plain formatter', 'Version' => '1.0', 'Author' => "JohansonLocker", 'AuthorEmail' => '', 'AuthorUrl' => '' ); Gdn::FactoryInstall('BBCodeFormatter', 'PlainFormatter', __FILE__, Gdn::FactorySingleton); class PlainFormatter extends Gdn_Plugin { public function Format($Text) { return "<font color=red>PlainFormatter<br><font><font color=0>".$Text; } public function Setup() {// Nothing to do here! } }


    but there's a bug - Factory doesn't work on Discussiom subject post.
  • solved - setting two factories.

    the one is bbcode for replies, and the other is html for subject with same parser.
Sign In or Register to comment.