2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: ruby.inc.php,v 1.8 2011/01/25 15:01:01 henoheno Exp $
5 // Ruby annotation plugin: Add a pronounciation into kanji-word or acronym(s)
6 // See also about ruby: http://www.w3.org/TR/ruby/
9 // Ruby tag works with MSIE only now,
10 // but readable for other browsers like: 'words(pronunciation)'
12 define('PLUGIN_RUBY_USAGE', '&ruby(pronunciation){words};');
14 function plugin_ruby_inline()
16 if (func_num_args() != 2) return PLUGIN_RUBY_USAGE;
18 list($ruby, $body) = func_get_args();
20 // strip_htmltag() is just for avoiding AutoLink insertion
21 $body = strip_htmltag($body);
23 if ($ruby == '' || $body == '') return PLUGIN_RUBY_USAGE;
25 return '<ruby><rb>' . $body . '</rb>' . '<rp>(</rp>' .
26 '<rt>' . htmlsc($ruby) . '</rt>' . '<rp>)</rp>' .