Correct the emphasis when there is multiple underscore or stars : cut at the first _ not, the last

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1791 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-09-03 12:48:54 +00:00
parent ee8559b657
commit a04b7c8aed

View File

@@ -68,10 +68,10 @@ class markdown
$search[] = "/^--+ (.+)( --+)?$/Um";
$replace[] = "</p>\n<h2>\\1</h2>\n<p>";
// EMPHASIS : _ or * for normal, __ or ** for strong
$search[] = "/__(.+)__/"; $replace[] = "<strong>\\1</strong>";
$search[] = "/_(.+)_/"; $replace[] = "<em>\\1</em>";
$search[] = "/\*\*(.+)\*\*/"; $replace[] = "<strong>\\1</strong>";
$search[] = "/\*(.+)\*/"; $replace[] = "<em>\\1</em>";
$search[] = "/__([^_]+)__/"; $replace[] = "<strong>\\1</strong>";
$search[] = "/_([^_]+)_/"; $replace[] = "<em>\\1</em>";
$search[] = "/\*\*([^*]+)\*\*/"; $replace[] = "<strong>\\1</strong>";
$search[] = "/\*([^*]+)\*/"; $replace[] = "<em>\\1</em>";
// CODE : `code` -> <code>
$search[] = "/\\n?\`((\\n|.)+)\`/Um";