BUG : the ### TITLEx doesn't work caused by the search empty line at the ned and at the start of the regex

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1491 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-06-25 19:35:29 +00:00
parent 3116a1f5c3
commit 284a4e2c5e

View File

@@ -94,22 +94,22 @@ class markdown
// TITLES // TITLES
// Titles ATX (Optionnal sharp at the end) // Titles ATX (Optionnal sharp at the end)
// ###### Title6 // ###### Title6
$search[] = "/\\n^###### ([^#]+)(#*)$\\n/Um"; $search[] = "/^###### ([^#]+)(#*)$/Um";
$replace[] = "</p>\n<h6>\\1</h6>\n<p>"; $replace[] = "</p>\n<h6>\\1</h6>\n<p>";
// ##### Title5 // ##### Title5
$search[] = "/\\n^##### ([^#]+)(#*)$\\n/Um"; $search[] = "/^##### ([^#]+)(#*)$/Um";
$replace[] = "</p>\n<h5>\\1</h5>\n<p>"; $replace[] = "</p>\n<h5>\\1</h5>\n<p>";
// #### Title4 // #### Title4
$search[] = "/\\n^#### ([^#]+)(#*)$\\n/Um"; $search[] = "/^#### ([^#]+)(#*)$/Um";
$replace[] = "</p>\n<h4>\\1</h4>\n<p>"; $replace[] = "</p>\n<h4>\\1</h4>\n<p>";
// ### Title3 // ### Title3
$search[] = "/\\n^### ([^#]+)(#*)$\\n/Um"; $search[] = "/^### ([^#]+)(#*)$/Um";
$replace[] = "</p>\n<h3>\\1</h3>\n<p>"; $replace[] = "</p>\n<h3>\\1</h3>\n<p>";
// ## Title2 // ## Title2
$search[] = "/\\n^## ([^#]+)(#*)$\\n/Um"; $search[] = "/^## ([^#]+)(#*)$/Um";
$replace[] = "</p>\n<h2>\\1</h2>\n<p>"; $replace[] = "</p>\n<h2>\\1</h2>\n<p>";
// # Title1 // # Title1
$search[] = "/\\n^# ([^#]+)(#*)$\\n/Um"; $search[] = "/^# ([^#]+)(#*)$/Um";
$replace[] = "</p>\n<h1>\\1</h1>\n<p>"; $replace[] = "</p>\n<h1>\\1</h1>\n<p>";
// End of line with double space : <br/> // End of line with double space : <br/>
$search[] = "/( )$/Um"; $replace[] = "<br/>"; $search[] = "/( )$/Um"; $replace[] = "<br/>";