mirror of
https://github.com/YunoHost-Apps/hubzilla_ynh.git
synced 2024-09-03 19:26:21 +02:00
22 lines
521 B
PHP
22 lines
521 B
PHP
<?php
|
|
/**
|
|
*
|
|
* Name: bbmath
|
|
* Description: Display math
|
|
* Version: 0.0
|
|
* Author: Stefan Parviainen <pafcu@iki.fi>
|
|
*
|
|
*/
|
|
|
|
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);
|
|
}
|