tags 367670 + patch upstream
tags 368442 + patch upstream
thanks

Hello all,

Attached to this mail is a patch that solves both problems.

* Concerning the multi-line span of emphasise (_):
  It seems that it was explicitly programmed to not be able to match
  across multiple lines.  I don't see why not? Nobody expects this
  since it _is_ allowed for italic (__), strong (*), etc.  Maybe this
  non-multi-line limit should be turned of for cite (??) as well?

* Concerning the greediness problem for strong (*) and bold (**):
  As mentioned on the list[0], this only seems to be a problem when
  single characters are made strong, bold, but also emphasised,
  subscripted, etc.  The reason was a small error in the regexp matching
  either a series of characters or exactly one.  It considered the case
  of one character later, since the Ruby RE-engine seems to look at
  alternatives from left-to-right.

I have mentioned the patch upstream and also reported the suggestion
for multi-line span of emphasise on textism.com, since it doesn't allow
for this as well.

Regards,

Paul

fn0. http://rubyforge.org/pipermail/redcloth-upwards/2006-July/000075.html

-- 
Student @ Eindhoven                         | email: [EMAIL PROTECTED]
University of Technology, The Netherlands   | JID: [EMAIL PROTECTED]
>>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181
--- lib/redcloth.rb.orig        2005-07-10 02:27:53.000000000 +0200
+++ lib/redcloth.rb     2006-09-06 13:08:33.000000000 +0200
@@ -364,7 +364,7 @@
         ['??', 'cite', :limit],
         ['-', 'del', :limit],
         ['__', 'i'],
-        ['_', 'em', :limit],
+        ['_', 'em'],
         ['%', 'span', :limit],
         ['+', 'ins', :limit],
         ['^', 'sup'],
@@ -379,14 +379,14 @@
                 (#{rcq})
                 (#{C})
                 (?::(\S+?))?
-                (\S.*?\S|\S)
+                (\S|\S.*?\S)
                 #{rcq}
                 (?=\W)/x
             else
                 /(#{rcq})
                 (#{C})
                 (?::(\S+))?
-                (\S.*?\S|\S)
+                (\S|\S.*?\S)
                 #{rcq}/xm 
             end
         [rc, ht, re, rtype]

Attachment: signature.asc
Description: Digital signature

Reply via email to