From 7e4102d10364044e08a6a8039e496ab8bc1762fe Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 25 Jun 2014 20:24:36 +0000 Subject: [PATCH] Allow characters with # in the titles git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1493 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- markdown.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/markdown.php b/markdown.php index 5115176..aa49295 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[] = "
";