=== modified file 'markdown.module'
--- old/markdown.module	2009-06-04 16:02:03 +0000
+++ new/markdown.module	2009-06-04 16:47:47 +0000
@@ -53,17 +53,33 @@
  * Implementation of hook_filter_tips().
  */
 function markdown_filter_tips($delta = 0, $format = -1, $long) {
-  if ($long) {
-    return t('Quick Tips:<ul>
-      <li>Two or more spaces at a line\'s end = Line break</li>
-      <li>Double returns = Paragraph</li>
-      <li>*Single asterisks* or _single underscores_ = <em>Emphasis</em></li>
-      <li>**Double** or __double__ = <strong>Strong</strong></li>
-      <li>This is [a link](http://the.link.example.com "The optional title text")</li>
-      </ul>For complete details on the Markdown syntax, see the <a href="http://daringfireball.net/projects/markdown/syntax">Markdown documentation</a> and <a href="http://michelf.com/projects/php-markdown/extra/">Markdown Extra documentation</a> for tables, footnotes, and more.');
+  if (variable_get("markdown_extra_$format", 1) == 1) {
+    if ($long) {
+      return t('Quick Tips:<ul>
+        <li>Two or more spaces at a line\'s end = Line break</li>
+        <li>Double returns = Paragraph</li>
+        <li>*Single asterisks* or _single underscores_ = <em>Emphasis</em></li>
+        <li>**Double** or __double__ = <strong>Strong</strong></li>
+        <li>This is [a link](http://the.link.example.com "The optional title text")</li>
+        </ul>For complete details on the Markdown syntax, see the <a href="http://daringfireball.net/projects/markdown/syntax">Markdown documentation</a> and <a href="http://michelf.com/projects/php-markdown/extra/">Markdown Extra documentation</a> for tables, footnotes, and more.');
+    }
+    else {
+      return t('You can use <a href="@filter_tips">Markdown syntax</a> to format and style the text. Also see <a href="@markdown_extra">Markdown Extra</a> for tables, footnotes, and more.', array('@filter_tips' => url('filter/tips'), '@markdown_extra' => 'http://michelf.com/projects/php-markdown/extra/'));
+    }
   }
   else {
-    return t('You can use <a href="@filter_tips">Markdown syntax</a> to format and style the text. Also see <a href="@markdown_extra">Markdown Extra</a> for tables, footnotes, and more.', array('@filter_tips' => url('filter/tips'), '@markdown_extra' => 'http://michelf.com/projects/php-markdown/extra/'));
+    if ($long) {
+      return t('Quick Tips:<ul>
+        <li>Two or more spaces at a line\'s end = Line break</li>
+        <li>Double returns = Paragraph</li>
+        <li>*Single asterisks* or _single underscores_ = <em>Emphasis</em></li>
+        <li>**Double** or __double__ = <strong>Strong</strong></li>
+        <li>This is [a link](http://the.link.example.com "The optional title text")</li>
+        </ul>For complete details on the Markdown syntax, see the <a href="http://daringfireball.net/projects/markdown/syntax">Markdown documentation</a>.');
+    }
+    else {
+      return t('You can use <a href="@filter_tips">Markdown syntax</a> to format and style the text.', array('@filter_tips' => url('filter/tips')));
+    }
   }
 }
 
@@ -107,7 +123,29 @@
 function _markdown_process($text, $format) {
   if (!empty($text)) {
     include_once drupal_get_path('module', 'markdown') .'/markdown.php';
-    $text = Markdown($text);
+
+    if(variable_get("markdown_extra_$format", 1) == 1) {
+
+      # Setup static parser variable.
+      static $markdown_extra_parser;
+      if (!isset($markdown_extra_parser)) {
+        $markdown_extra_parser = new MarkdownExtra_Parser;
+      }
+
+      # Transform text using parser.
+      $text = $markdown_extra_parser->transform($text);
+    } else {
+
+      # Setup static parser variable.
+      static $markdown_parser;
+      if (!isset($markdown_parser)) {
+        $markdown_parser = new Markdown_Parser;
+      }
+
+      # Transform text using parser.
+      $text = $markdown_parser->transform($text);
+
+    }
   }
   return $text;
 }
@@ -121,6 +159,12 @@
     '#type' => 'fieldset',
     '#title' => t('Markdown'),
   );
+  $form['markdown_wrapper']["markdown_extra_$format"] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use Markdown Extra Syntax'),
+    '#default_value' => variable_get("markdown_extra_$format", 1),
+    '#description' => t('If enabled, use the full Markdown Extra syntax instead of vanilla Markdown.'),
+  );
   $links = array(
     'Markdown PHP Version: <a href="http://www.michelf.com/projects/php-markdown/">'. MARKDOWN_VERSION .'</a>',
     'Markdown Extra Version: <a href="http://www.michelf.com/projects/php-markdown/">'. MARKDOWNEXTRA_VERSION .'</a>',

