public static function format($text) { StudipFormat::addStudipMarkup("blubberhashtag", "(^|\\s)#([\\w\\d_\\.\\-]*[\\w\\d])", "", "ForumPosting::markupHashtags"); $output = formatReady($text); StudipFormat::removeStudipMarkup("blubberhashtag"); return $output; }
/** * Special format-function that adds hashtags to the common formatReady-markup. * @param string $text : original text with studip-markup plus hashtags * @return string : formatted text */ public static function format($text) { StudipFormat::addStudipMarkup("blubberhashtag", BlubberPosting::$hashtags_regexp, null, "BlubberPosting::markupHashtags"); $output = formatReady($text); StudipFormat::removeStudipMarkup("blubberhashtag"); return $output; }
public function testRemoveStudipMarkup() { StudipFormat::removeStudipMarkup('bold'); $markup = new StudipFormat(); $input = '**some %%code%%**'; $expected = '**some <em>code</em>**'; $this->assertEquals($expected, $markup->format($input)); }