FIX Markdown - headers

This commit is contained in:
Krivchikov Dmitry 2015-09-30 23:58:09 +03:00
parent ccbf28cf07
commit bb152d028b
1 changed files with 5 additions and 5 deletions

View File

@ -17,16 +17,16 @@ class Markdown
static private function replaceHeaders($string) static private function replaceHeaders($string)
{ {
$pr = '(^#{1} (.{1,}))'; $pr = '(### (.{1,}))';
$rep = '<h2>$1</h2>'; $rep = '<h4>$1</h4>';
$string = preg_replace($pr, $rep, $string); $string = preg_replace($pr, $rep, $string);
$pr = '(^#{2} (.{1,}))'; $pr = '(## (.{1,}))';
$rep = '<h3>$1</h3>'; $rep = '<h3>$1</h3>';
$string = preg_replace($pr, $rep, $string); $string = preg_replace($pr, $rep, $string);
$pr = '(^#{3} (.{1,}))'; $pr = '(# (.{1,}))';
$rep = '<h4>$1</h4>'; $rep = '<h2>$1</h2>';
$string = preg_replace($pr, $rep, $string); $string = preg_replace($pr, $rep, $string);
return $string; return $string;