Simplify the regex in markdown to found the emphasis strings

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1793 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-09-03 12:52:22 +00:00
parent 5315e46fc1
commit 941701004f

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[] = "/__(.+)__/U"; $replace[] = "<strong>\\1</strong>";
$search[] = "/_(.+)_/U"; $replace[] = "<em>\\1</em>";
$search[] = "/\*\*(.+)\*\*/U"; $replace[] = "<strong>\\1</strong>";
$search[] = "/\*(.+)\*/U"; $replace[] = "<em>\\1</em>";
// CODE : `code` -> <code>
$search[] = "/\\n?\`((\\n|.)+)\`/Um";