? easylists_multiple_issues.patch
? easylists_short_tags.patch
Index: easylists-filter.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/easylists/easylists-filter.inc,v
retrieving revision 1.3
diff -u -p -r1.3 easylists-filter.inc
--- easylists-filter.inc	6 Jun 2007 14:42:10 -0000	1.3
+++ easylists-filter.inc	1 Apr 2008 22:29:41 -0000
@@ -1,4 +1,4 @@
-<?
+<?php
 // $Id: easylists-filter.inc,v 1.3 2007/06/06 14:42:10 deelight Exp $
 
 // Credits: most of the parsing code is taken from MediaWiki 1.10.0
@@ -7,13 +7,13 @@
 function _easylists_filter_process(&$body, $format = -1)
 {
   $listprocessor = new listprocessor;
-  $body = $listprocessor->process($body);
+  $body = $listprocessor->process($body, variable_get('easylists_character_' . $format, '-'));
   return $body;
 }
 
 class listprocessor
 {
-  function process($body)
+  function process($body, $token)
   {
     $textLines = explode( "\n", $body );
     $lastPrefix = $output = '';
@@ -23,15 +23,16 @@ class listprocessor
     foreach ( $textLines as $oLine )
     {
       // lists
+      $oLine = trim($oLine);
       $lastPrefixLength = strlen( $lastPrefix );
-      $prefixLength = strspn( $oLine, '-' );
+      $prefixLength = strspn( $oLine, $token );
       $pref = substr( $oLine, 0, $prefixLength );
       $t = substr( $oLine, $prefixLength );
  
       if( $prefixLength && 0 == strcmp( $lastPrefix, $pref ) )
       {
         # Same as the last item, so no need to deal with nesting or opening stuff
-        $output .= $this->nextItem( substr( $pref, -1 ) );
+        $output .= $this->nextItem( $token, substr( $pref, -1 ) );
         $paragraphStack = false;
       }
       elseif( $prefixLength || $lastPrefixLength )
@@ -41,15 +42,15 @@ class listprocessor
         $paragraphStack = false;
         while( $commonPrefixLength < $lastPrefixLength )
         {
-          $output .= $this->closeList( $lastPrefix{$lastPrefixLength-1} );
+          $output .= $this->closeList( $token, $lastPrefix{$lastPrefixLength-1} );
           --$lastPrefixLength;
         }
         if ( $prefixLength <= $commonPrefixLength && $commonPrefixLength > 0 ) {
-          $output .= $this->nextItem( $pref{$commonPrefixLength-1} );
+          $output .= $this->nextItem( $token, $pref{$commonPrefixLength-1} );
         }
         while ( $prefixLength > $commonPrefixLength ) {
           $char = substr( $pref, $commonPrefixLength, 1 );
-          $output .= $this->openList( $char, $prefixLength > 1 );
+          $output .= $this->openList( $token, $char, $prefixLength > 1 );
           ++$commonPrefixLength;
         }
         $lastPrefix = $pref;
@@ -61,7 +62,7 @@ class listprocessor
       }
     }  
     while ( $prefixLength ) {
-      $output .= $this->closeList( $pref{$prefixLength-1} );
+      $output .= $this->closeList( $token, $pref{$prefixLength-1} );
       --$prefixLength;
     }
     if ( '' != $this->mLastSection ) {
@@ -84,7 +85,7 @@ class listprocessor
     return $i;
   }
 
-  function openList( $char, $sublist=false )
+  function openList( $token, $char, $sublist=false )
   {
     $result = $this->closeParagraph();
     if ($sublist)
@@ -92,7 +93,7 @@ class listprocessor
     else
       $class = "easylist";
 
-    if ( '-' == $char ) { $result .= '<ul class="'.$class.'"><li>'; }
+    if ( $token == $char ) { $result .= '<ul class="'.$class.'"><li>'; }
     else { $result = '<!-- ERR 1 -->'; }
     return $result;
   }
@@ -107,13 +108,13 @@ class listprocessor
     return $result;
   }
 
-  function nextItem( $char ) {
-    if ( '-' == $char ) { return '</li><li>'; }
+  function nextItem( $token, $char ) {
+    if ( $token == $char ) { return '</li><li>'; }
     return '<!-- ERR 2 -->';
   }
 
-  function closeList( $char ) {
-    if ( '-' == $char ) { $text = '</li></ul>'; }
+  function closeList( $token, $char ) {
+    if ( $token == $char ) { $text = '</li></ul>'; }
     else {  return '<!-- ERR 3 -->'; }
     return $text."\n";
   }
Index: easylists.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/easylists/easylists.module,v
retrieving revision 1.1
diff -u -p -r1.1 easylists.module
--- easylists.module	21 May 2007 12:57:22 -0000	1.1
+++ easylists.module	1 Apr 2008 22:29:41 -0000
@@ -1,4 +1,4 @@
-<?
+<?php
 // $Id: easylists.module,v 1.1 2007/05/21 12:57:22 deelight Exp $
 
 /**
@@ -20,9 +20,30 @@ function easylists_filter($op, $delta = 
       return t('Converts EasyLists to HTML.');
     case 'process':
       include_once(drupal_get_path('module', 'easylists') .'/easylists-filter.inc');
+      echo $format;
       return _easylists_filter_process($text, $format);
+    case 'settings':
+      $form = array();
+      $form['easylists'] = array( 
+        '#type' => 'fieldset',
+        '#title' => t('EasyLists'),
+        '#collapsible' => TRUE,
+      );
+      $form['easylists']['easylists_character_' . $format] = array( 
+        '#type' => 'textfield',
+        '#title' => t('Bullet character'),
+        '#default_value' => variable_get('easylists_character_' . $format, '-'),
+        '#description' => t('The character that will be changed into a bullet point'),
+      );
+      return $form;
     default:
       return $text;
   }
 }
 
+/**
+ * Implementation of hook_filter_tips().
+ */
+function easylists_filter_tips($delta, $format, $long = FALSE) {
+  return t('Make a bullet list by starting each line with a \'!char\'. Add more for sublists.', array('!char' => variable_get('easylists_character_' . $format, '-')));
+}
