\r
<h3>Hyper Links</h3>\r
\r
-Links can be placed in the text and are followed (with no spaces) by the text to be displayed in brackets. Example: </em>http://www.google.com/(Search Now)</em> will be converted to \r
-<a href="http://www.google.com/">Search Now</a>.\r
+<p>Links can be placed in the text and are followed (with no spaces) by the text to be displayed in brackets. Example: </em>http://www.google.com/(Search Now)</em> will be converted to \r
+<a href="http://www.google.com/">Search Now</a>.</p>\r
+\r
+<p>Mail links can be acheived the same way, e.g.,</p>\r
+<p>nobody@example.com(Test User) will be converted to\r
+<a href="mailto:nobody@example.com">Test User</a></p>\r
\r
<h3>Moodle Module Links</h3>\r
\r
$line = eregi_replace("([[:space:]])www\.([^[:space:]]*)([[:alnum:]#?/&=])", \r
"\\1<A HREF=\"http://www.\\2\\3\" TARGET=\"newpage\">www.\\2\\3</A>", $line);\r
\r
+ // make email addresses into mailtos....\r
+ $line = eregi_replace("([[:space:]]|^)([a-zA-Z0-9@.]+)\(([^)]+)\)",\r
+ "\\1<a href=\"mailto:\\2\">\\3</a>", $line);\r
+\r
// !# at the beginning of any lines means a heading\r
$line = eregi_replace( "^!([1-6]) (.*)$", "<h\\1>\\2</h\\1>", $line );\r
\r
global $course; // This is a bit risky - it won't work everywhere\r
\r
if ($CFG->slasharguments) {\r
- $line = eregi_replace( "/([a-zA-Z./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
+ $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
"<img src=\"$CFG->wwwroot/file.php/$course->id/\\1\\2\" alt=\"\\3\" />", $line );\r
} else {\r
- $line = eregi_replace( "/([a-zA-Z./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
+ $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
"<img src=\"$CFG->wwwroot/file.php\?file=$course->id/\\1\\2\" alt=\"\\3\" />", $line );\r
}\r
\r