From fc9eddd08b7026f7f166ef85dc14ac9ece4fc937 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 4 Jan 2009 08:33:32 -0800 Subject: [PATCH] scorify the emoticons extension --- contrib/emoticons/main.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/contrib/emoticons/main.php b/contrib/emoticons/main.php index 9144c2eb..9cc1d34f 100644 --- a/contrib/emoticons/main.php +++ b/contrib/emoticons/main.php @@ -6,22 +6,14 @@ * Description: Turn :smile: into a link to smile.gif */ -class Emoticons implements Extension { - public function receive_event(Event $event) { - if($event instanceof TextFormattingEvent) { - $event->formatted = $this->bbcode_to_html($event->formatted); - $event->stripped = $this->bbcode_to_text($event->stripped); - } - } - - private function bbcode_to_html($text) { +class Emoticons extends FormatterExtension { + public function format($text) { $data_href = get_base_href(); $text = preg_replace("/:([a-z]*?):/s", "", $text); return $text; } - private function bbcode_to_text($text) { - // $text = preg_replace("/:([a-z]*?):/s", "\\1", $text); + public function strip($text) { return $text; } }