1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00
hubzilla_ynh/sources/addon/bbmath/bbmath.php
2016-04-17 22:42:29 +05:30

22 lines
538 B
PHP

<?php
/**
*
* Name: bbmath
* Description: Display math
* Version: 0.0
* Author: Stefan Parviainen <pafcu@iki.fi>
* Maintainer: none
*/
require_once('phplatex.php');
function bbmath_load() {
register_hook('bbcode','addon/bbmath/bbmath.php','bbmath_bbcode');
}
function bbmath_unload() {
unregister_hook('bbcode','addon/bbmath/bbmath.php','bbmath_bbcode');
}
function bbmath_bbcode($a,&$text) {
$text = preg_replace_callback('|\[tex\](.*?)\[/tex\]|',function($m) { return texify($m[1]); },$text);
}