3 require_once('include/bbcode.php');
4 require_once('library/markdown.php');
5 require_once('include/bb2diaspora.php');
6 require_once('include/html2bbcode.php');
8 function visible_lf($s) {
9 return str_replace("\n",'<br />', $s);
12 function babel_content(&$a) {
14 $o .= '<h3>Babel Diagnostic</h3>';
16 $o .= '<form action="babel" method="post">';
17 $o .= t('Source (bbcode) text:') . EOL . '<textarea name="text" >' . htmlspecialchars($_REQUEST['text']) .'</textarea>' . EOL;
18 $o .= '<input type="submit" name="submit" value="Submit" /></form>';
22 if(x($_REQUEST,'text')) {
24 $text = trim($_REQUEST['text']);
25 $o .= t("Source input: ") . EOL. EOL;
26 $o .= visible_lf($text) . EOL. EOL;
28 $html = bbcode($text);
29 $o .= t("bb2html: ") . EOL. EOL;
30 $o .= $html. EOL. EOL;
32 $bbcode = html2bbcode($html);
33 $o .= t("bb2html2bb: ") . EOL. EOL;
34 $o .= visible_lf($bbcode) . EOL. EOL;
36 $diaspora = bb2diaspora($text);
37 $o .= t("bb2md: ") . EOL. EOL;
38 $o .= visible_lf($diaspora) . EOL. EOL;
40 $html = Markdown($diaspora);
41 $o .= t("bb2md2html: ") . EOL. EOL;
42 $o .= $html. EOL. EOL;
44 $bbcode = diaspora2bb($diaspora);
45 $o .= t("bb2dia2bb: ") . EOL. EOL;
46 $o .= visible_lf($bbcode) . EOL. EOL;
48 $bbcode = html2bbcode($html);
49 $o .= t("bb2md2html2bb: ") . EOL. EOL;
50 $o .= visible_lf($bbcode) . EOL. EOL;