This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/emoticons/main.php
Matthew Barbour ac6ded877f Added dependency support for extensions
Separated a few extensions that had multiple extension classes in the same file
2019-08-07 16:32:44 -05:00

21 lines
398 B
PHP

<?php
/**
* Class Emoticons
*/
class Emoticons extends FormatterExtension
{
public function format(string $text): string
{
$data_href = get_base_href();
$text = preg_replace("/:([a-z]*?):/s", "<img src='$data_href/ext/emoticons/default/\\1.gif'>", $text);
return $text;
}
public function strip(string $text): string
{
return $text;
}
}