* Markdown : remove http:// mandatory in links : can be relative !

* Markdown : add image support (http://daringfireball.net/projects/markdown/syntax )


git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1787 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-09-03 09:21:48 +00:00
parent 8d7f1549e8
commit 91cc086b67

View File

@@ -77,12 +77,15 @@ class markdown
$search[] = "/\\n?\`((\\n|.)+)\`/Um";
$replace[] = "<code>\\1</code>";
// LINKS
// LINKS (can be relative)
// images
$search[] = "(!\[(.+)\]\((.+)\))";
$replace[] = "<img src='\\2' alt='\\1'/>";
// [Google Site](http://google.fr/ "With help bubble")
$search[] = "(\[(.+)\]\((https?://.+) \"(.+)\"\))";
$search[] = "(\[(.+)\]\((.+) \"(.+)\"\))";
$replace[] = "<a href='\\2' title='\\3'>\\1</a>";
// [Google Site](http://google.fr/)
$search[] = "(\[(.+)\]\((http.+)\))"; $replace[] = "<a href='\\2'>\\1</a>";
$search[] = "(\[(.+)\]\((.+)\))"; $replace[] = "<a href='\\2'>\\1</a>";
// Automatics links :
// <http://dominique.fournier38.fr>
// <dominique@fournier38.fr>