BUG : * * * - - - shoud be SEPARATORS
BUG : the mails/url are not working caused by htmlentities git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1485 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
15
markdown.php
15
markdown.php
@@ -33,6 +33,11 @@ class markdown
|
||||
$search[] = "/^(.+)\\n--+$\\n/Um";
|
||||
$replace[] = "\n<h2>\\1</h2>\n";
|
||||
|
||||
// SEPARATORS : *** --- ___ * * * - - - _ _ _
|
||||
// Must be placed before EMPHASIS
|
||||
$search[] = "/^[*_-] ?[*_-] ?[*_-]$/Um";
|
||||
$replace[] = "</p>\n<hr/>\n<p>";
|
||||
|
||||
$mark = preg_replace ($search, $replace, $mark);
|
||||
|
||||
|
||||
@@ -46,16 +51,12 @@ class markdown
|
||||
return the html */
|
||||
private function paragraph ($mark)
|
||||
{
|
||||
// Think thereis already htmlentities passed on $mark !!!
|
||||
$timeStart = microtime (TRUE);
|
||||
$timeregex = 0;
|
||||
// Initialization of convertions
|
||||
$search = array ();
|
||||
$replace = array ();
|
||||
// SEPARATORS : *** --- ___ * * * - - - _ _ _
|
||||
// Must be placed before EMPHASIS
|
||||
$search[] = "/\\n^[*_-] ?[*_-] ?[*_-]$/Um";
|
||||
$replace[] = "</p>\n<hr/>\n<p>";
|
||||
|
||||
// Titles short
|
||||
// == TITRE1
|
||||
$search[] = "/^==+ (.+)( ==+)?$/Um";
|
||||
@@ -82,8 +83,8 @@ class markdown
|
||||
// Automatics links :
|
||||
// <http://dominique.fournier38.fr>
|
||||
// <dominique@fournier38.fr>
|
||||
$search[] = "(\<(https?://.+)\>)"; $replace[] = "<a href='\\1'>\\1</a>";
|
||||
$search[] = "(\<(.+@.+)\>)"; $replace[] = "<a href='mailto:\\1'>\\1</a>";
|
||||
$search[] = "#<(https?://.+)>#"; $replace[] = "<a href='\\1'>\\1</a>";
|
||||
$search[] = "#<(.+@.+)>#"; $replace[] = "<a href='mailto:\\1'>\\1</a>";
|
||||
// TODO : Links by reference :
|
||||
// Voici un petit texte écrit par [Michel Fortin][mf].
|
||||
// [mf]: http://michelf.ca/ "Mon site web"
|
||||
|
||||
Reference in New Issue
Block a user