OSDN Git Service

BugTrack/791: Fix typo 0,91 => 0.91
[pukiwiki/pukiwiki.git] / plugin / ruby.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: ruby.inc.php,v 1.5 2005/01/04 14:25:24 henoheno Exp $
4 //
5 // Ruby annotation plugin: Add a pronounciation into kanji-word or acronym(s)
6 // See also about ruby: http://www.w3.org/TR/ruby/
7 //
8 // NOTE:
9 //  Ruby tag works with MSIE only now,
10 //  but readable for other browsers like: 'words(pronunciation)'
11
12 define('PLUGIN_RUBY_USAGE', '&ruby(pronunciation){words};');
13
14 function plugin_ruby_inline()
15 {
16         if (func_num_args() != 2) return PLUGIN_RUBY_USAGE;
17
18         list($ruby, $body) = func_get_args();
19         if ($ruby == '' || $body == '') return PLUGIN_RUBY_USAGE;
20
21         return '<ruby><rb>' . $body . '</rb>' . '<rp>(</rp>' .
22                 '<rt>' .  htmlspecialchars($ruby) . '</rt>' . '<rp>)</rp>' .
23                 '</ruby>';
24 }
25 ?>