From 7fea3a6e3d7e78e943b6ee19f3d48b3414b7542f Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 14 Feb 2010 13:31:39 +0000 Subject: Add 'center' by writing '=some text='. --- utils/markdown.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/utils/markdown.php b/utils/markdown.php index dd6416b..89a85b2 100644 --- a/utils/markdown.php +++ b/utils/markdown.php @@ -2449,9 +2449,16 @@ class MarkdownExtra_Parser extends Markdown_Parser { $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); if ($is_p) { - $value = "
" . $value . "
"; - //$value = "

" . $value . "

"; - //$value = "
$value
"; + $centerl = ""; + $centerr = ""; + if(strlen($value) > 2 && $value[0] == '=' && + $value[strlen($value)-1] == '=') { + $centerl = "
"; + $centerr = "
"; + $value = substr($value, 1, strlen($value) - 2); + } + $value = "
" . + $centerl . $value . $centerr . "
"; } $grafs[$key] = $value; } -- cgit v1.2.3