if (!isset($options->para)) {
$options->para=true;
}
- if (!empty($CFG->librarypath)) {
- if (file_exists("$CFG->dirroot/$CFG->librarypath/librarylib.php")) {
- include_once("$CFG->dirroot/$CFG->librarypath/librarylib.php");
- $text = librarytexttohtml($text);
- }
- }
return text_to_html($text, $options->smiley, $options->para);
break;
}
/// Given plain text, makes it into HTML as nicely as possible.
/// May contain HTML tags already
+ global $CFG;
+
/// Remove any whitespace that may be between HTML tags
$text = eregi_replace(">([[:space:]]+)<", "><", $text);
/// Make returns into HTML newlines.
$text = nl2br($text);
+/// Insert links to library pages if Library is being used
+ if (!empty($CFG->librarypath)) {
+ if (file_exists("$CFG->dirroot/$CFG->librarypath/librarylib.php")) {
+ include_once("$CFG->dirroot/$CFG->librarypath/librarylib.php");
+ $text = librarytexttohtml($text);
+ }
+ }
+
/// Turn smileys into images.
if ($smiley) {
replace_smilies($text);