Index: marksmarty.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/marksmarty/marksmarty.module,v
retrieving revision 1.13.4.3
diff -u -w -B -F^f -r1.13.4.3 marksmarty.module
--- marksmarty.module	7 Oct 2006 19:39:47 -0000	1.13.4.3
+++ marksmarty.module	6 May 2007 19:23:14 -0000
@@ -105,10 +105,12 @@ function _marksmarty_settings($format) {
     '#options' => array(0 => t('"--" for em-dashes; no en-dash support'), 1 => t('"---" for em-dashes; "--" for en-dashes'), 2 => t('"--" for em-dashes; "---" for en-dashes')),
   );
 
-  $the_output = '<p>Markdown PHP Version: <a href="http://www.michelf.com/projects/php-markdown/">'.$GLOBALS['MarkdownPHPVersion'].'</a><br />';
-  $the_output .= 'Markdown Syntax Version: '.$GLOBALS['MarkdownSyntaxVersion'].'<br />';
-  $the_output .= 'SmartyPants PHP Version: <a href="http://www.michelf.com/projects/php-smartypants/">'.$GLOBALS['SmartyPantsPHPVersion'].'</a><br />';
-  $the_output .= 'SmartyPants Syntax Version: '.$GLOBALS['SmartyPantsSyntaxVersion'] .'</p>';
+  $version = _marksmarty_version();
+  $the_output = "
+    <p>Markdown PHP Version: <a href=\"http://www.michelf.com/projects/php-markdown/\">$version[readable]</a><br />
+    Markdown Syntax Version: $version[syntax]<br />
+    SmartyPants PHP Version: <a href=\"http://www.michelf.com/projects/php-smartypants/\">$GLOBALS[SmartyPantsPHPVersion]</a><br />
+    SmartyPants Syntax Version: $GLOBALS[SmartyPantsSyntaxVersion]</p>";
 
   $form['markdown_settings']['markdown_status'] = array(
     '#type' => 'markup',
@@ -118,4 +120,28 @@ function _marksmarty_settings($format) {
   return $form;
 }
 
+function _marksmarty_version() {
+  require_once(dirname(__FILE__) . '/markdown.php');
+  if (isset($GLOBALS['MarkdownPHPVersion'])) {
+    // before 1.0.1d
+    list ($version['extra'], $version['markdown']) = explode(' ', $GLOBALS['MarkdownPHPVersion']);  // 'Extra 1.0.1' or '1.0.1'
+    if (!$version['markdown']) {
+      $version['markdown'] = $version['extra'];
+      $version['extra'] = FALSE;
+    }
+    else {
+      $version['extra'] = $version['markdown'];
+    }
+    $version['readable'] = $GLOBALS['MarkdownPHPVersion'];
+  }
+  else {
+    // 1.0.1d and up
+    $version['markdown'] = MARKDOWN_VERSION;
+    $version['extra'] = defined('MARKDOWNEXTRA_VERSION') ? MARKDOWNEXTRA_VERSION : FALSE;
+    $version['readable'] = $version['extra'] ? "Extra $version[extra]" : $version['markdown'];
+  }
+  $version['syntax'] = '1.0.1';
+  return $version;
+}
+
 ?>
