diff --git a/markdown.php b/markdown.php index aa49295..7997542 100644 --- a/markdown.php +++ b/markdown.php @@ -94,22 +94,22 @@ class markdown // TITLES // Titles ATX (Optionnal sharp at the end) // ###### Title6 - $search[] = "/^###### (.+)(#*)$/Um"; + $search[] = "/^###### (.+)( +#*)$/Um"; $replace[] = "

\n
\\1
\n

"; // ##### Title5 - $search[] = "/^##### (.+)(#*)$/Um"; + $search[] = "/^##### (.+)( +#*)$/Um"; $replace[] = "

\n
\\1
\n

"; // #### Title4 - $search[] = "/^#### (.+)(#*)$/Um"; + $search[] = "/^#### (.+)( +#*)$/Um"; $replace[] = "

\n

\\1

\n

"; // ### Title3 - $search[] = "/^### (.+)(#*)$/Um"; + $search[] = "/^### (.+)( +#*)$/Um"; $replace[] = "

\n

\\1

\n

"; // ## Title2 - $search[] = "/^## (.+)(#*)$/Um"; + $search[] = "/^## (.+)( +#*)$/Um"; $replace[] = "

\n

\\1

\n

"; // # Title1 - $search[] = "/^# (.+)(#*)$/Um"; + $search[] = "/^# (.+)( +#*)$/Um"; $replace[] = "

\n

\\1

\n

"; // End of line with double space :
$search[] = "/( )$/Um"; $replace[] = "
";