? markdown.info
? markdown.module
? split_markdown.patch
Index: marksmarty.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/marksmarty/marksmarty.info,v
retrieving revision 1.2
diff -u -p -r1.2 marksmarty.info
--- marksmarty.info	22 Jan 2008 20:55:38 -0000	1.2
+++ marksmarty.info	22 Feb 2008 12:20:09 -0000
@@ -1,5 +1,5 @@
-name = Marksmarty
-description = Allows content to be submitted using Markdown, a simple plain-text syntax that is transformed into valid XHTML, and/or using SmartyPants, a filter for auto-translating plain ASCII characters to Unicode characters.
+name = Markdown
+description = Allows content to be submitted using Markdown, a simple plain-text syntax that is transformed into valid XHTML.
 package = "Input filters"
 dependencies[] = filter
 core = 6.x
\ No newline at end of file
Index: marksmarty.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/marksmarty/marksmarty.module,v
retrieving revision 1.22
diff -u -p -r1.22 marksmarty.module
--- marksmarty.module	20 Feb 2008 18:07:59 -0000	1.22
+++ marksmarty.module	22 Feb 2008 12:20:09 -0000
@@ -5,43 +5,40 @@
  * Drupal Hooks
  ********************************************************************/
 
-function marksmarty_filter($op, $delta = 0, $format = -1, $text = '') {
+function markdown_filter($op, $delta = 0, $format = -1, $text = '') {
   switch ($op) {
     case 'list':
-      return array(t('Markdown with SmartyPants'));
+      return array(t('Markdown'));
 
     case 'description':
-      return t('Allows content to be submitted using Markdown, a simple plain-text syntax that is filtered into valid XHTML, and converts plain ASCII characters to Unicode entities using SmartyPants.');
-
-    case 'settings':
-      return _marksmarty_settings($format);
+      return t('Allows content to be submitted using Markdown, a simple plain-text syntax that is filtered into valid XHTML.');
 
     case 'process':
-      return _marksmarty_process($text, $format);
+      return _markdown_process($text, $format);
 
     default:
       return $text;
   }
 }
 
-function marksmarty_block($op = 'list', $delta = 0, $edit = array()) {
+function markdown_block($op = 'list', $delta = 0, $edit = array()) {
   if ($op == 'list') {
-    $blocks[0] = array('info' => t('Marksmarty Filter Tips'));
+    $blocks[0] = array('info' => t('Markdown Filter Tips'));
     return $blocks;
   }
   else if ($op == 'view') {
     switch($delta) {
       case 0:
         $block = array('subject' => t('Title of block #1'),
-                       'content' => marksmarty_display_block_1());
+                       'content' => markdown_display_block_1());
         break;
     }
     return $block;
   }
 }
 
-function marksmarty_display_block_1(){
-  $content = <<<END_MARKSMARTY_BLOCK
+function markdown_display_block_1(){
+  $content = <<<END_markdown_BLOCK
 <pre>
 ## Header 2 ## 
 ### Header 3 ###  
@@ -69,13 +66,13 @@ And now some code:
     // Code is indented text
     is_easy() to_remember();
                             </pre>
-END_MARKSMARTY_BLOCK;
+END_markdown_BLOCK;
 
   return $content;
 
 }
 
-function marksmarty_filter_tips($delta = 0, $format = -1, $long) {
+function markdown_filter_tips($delta = 0, $format = -1, $long) {
   if ($long) {
     $the_output = t('Quick Tips:<ul>
       <li>Two or more spaces at a line\'s end = Line break</li>
@@ -92,14 +89,15 @@ function marksmarty_filter_tips($delta =
   return $the_output;
 }
 
-function marksmarty_help($path = 'admin/help#marksmarty', $arg) {
+function markdown_help($path = 'admin/help#markdown', $arg) {
   switch ($path) {
     case 'admin/settings/modules#description':
-      $the_output = t('Allows content to be submitted using Markdown, a simple plain-text syntax that is transformed into valid XHTML, and/or using SmartyPants, a filter for auto-translating plain ASCII characters to Unicode characters.');
+      $the_output = t('Allows content to be submitted using Markdown, a simple plain-text syntax that is transformed into valid XHTML.');
       break;
 
-    case 'admin/help#marksmarty':
-      $the_output = t('<p>The Markdown with SmartyPants module allows you to enter content using <a href="http://daringfireball.net/projects/markdown">Markdown</a>, a simple plain-text syntax that is transformed into valid XHTML, and will automatically convert plain ASCII characters to their proper Unicode entities in context ("curly quotes," et al.) using <a href="http://daringfireball.net/projects/smartypants">SmartyPants</a>.</p>');
+    case 'admin/help#markdown':
+      $the_output = t('<p>The Markdown with SmartyPants module allows you to enter content using <a href="http://daringfireball.net/projects/markdown">Markdown</a>, a simple plain-text syntax that is transformed into valid XHTML.</p>'.
+      '<p>Please read the <a href="http://daringfireball.net/projects/markdown/syntax">Markdown documentation</a> for full details on its formatting syntax.</p>');
       break;
   }
   if (isset($the_output)) {
@@ -111,63 +109,7 @@ function marksmarty_help($path = 'admin/
  * Module Functions
  ********************************************************************/
 
-function _marksmarty_process($text, $format) {
-  if (!empty($text) && variable_get("marksmarty_is_markdown_on_$format", 1) == 1) {
-    require_once(dirname(__FILE__) .'/markdown.php');
-    $text = Markdown($text);
-  }
-  if (!empty($text) && variable_get("marksmarty_is_smarty_on_$format", 1) == 1) {
-    global $smartypants_attr;
-    require_once(dirname(__FILE__) .'/smartypants.php');
-      
-    $smartypants_attr = variable_get("marksmarty_smarty_hyphens_$format", 0) + 1;
-    $text = SmartyPants($text);
-  }
-  return $text;
-}
-
-function _marksmarty_settings($format) {
+function _markdown_process($text, $format) {
   require_once(dirname(__FILE__) .'/markdown.php');
-  require_once(dirname(__FILE__) .'/smartypants.php');
-  $form['markdown_settings'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Markdown with SmartyPants'),
-    '#collapsible' => TRUE,
-    '#collapsed' => TRUE,
-  );
-  $form['markdown_settings']['help'] = array(
-    '#type' => 'markup',
-    '#value' => '<p>Please read the <a href="http://daringfireball.net/projects/markdown/syntax">Markdown documentation</a> for full details on its formatting syntax.</p>',
-  );
-  $form['markdown_settings']["marksmarty_is_markdown_on_$format"] = array(
-    '#type' => 'select',
-    '#title' => t('Enable Markdown?'),
-    '#default_value' => variable_get("marksmarty_is_markdown_on_$format", 1),
-    '#options' => array(0 => t('No'), 1 => t('Yes')),
-  );
-  $form['markdown_settings']["marksmarty_is_smarty_on_$format"] = array(
-    '#type' => 'select',
-    '#title' => t('Enable SmartyPants?'),
-    '#default_value' => variable_get("marksmarty_is_smarty_on_$format", 1),
-    '#options' => array(0 => t('No'), 1 => t('Yes')),
-  );
-  $form['markdown_settings']["marksmarty_smarty_hyphens_$format"] = array(
-    '#type' => 'select',
-    '#title' => t('Hyphenation settings for SmartyPants'),
-    '#default_value' => variable_get("marksmarty_smarty_hyphens_$format", 0),
-    '#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')),
-  );
-
-  $links[] = 'Markdown PHP Version: <a href="http://www.michelf.com/projects/php-markdown/">'. MARKDOWN_VERSION .'</a>';
-  $links[] .= 'Markdown Extra Version: '. MARKDOWNEXTRA_VERSION;
-  $links[] .= 'SmartyPants PHP Version: <a href="http://www.michelf.com/projects/php-smartypants/">'. $GLOBALS['SmartyPantsPHPVersion'] .'</a>';
-  $links[] .= 'SmartyPants Syntax Version: '. $GLOBALS['SmartyPantsSyntaxVersion'];
-
-  $form['markdown_settings']['markdown_status'] = array(
-    '#title' => t('Versions'),
-    '#type' => 'item',
-    '#value' => theme('item_list', $links),
-  );
-
-  return $form;
+  return Markdown($text);
 }
\ No newline at end of file
