Project

General

Profile

Actions

Defect #1225

closed

Textile: bold, italics, underline, etc... not working after parentheses

Added by Philip Hofstetter almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
Wiki
Target version:
Start date:
2008-05-12
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

the textile inline formating markers (*, _, +) don't work right after parentheses. An example is the following which should of course be marked as italics, but isn't:

some italizised text

The following patch to redcloth.rb fixes the problem:

--- redmine-0.7.1/lib/redcloth.rb    2008-05-04 12:30:06.000000000 +0200
+++ redmine/lib/redcloth.rb    2008-05-12 17:25:16.803532888 +0200
@@ -376,13 +376,13 @@
         re =
             case rtype
             when :limit
-                /(^|[>\s])
+                /(^|[>\W])
                 (#{rcq})
                 (#{C})
                 (?::(\S+?))?
                 ([^\s\-].*?[^\s\-]|\w)
                 #{rcq}
-                (?=[[:punct:]]|\s|$)/x
+                (?=[[:punct:]]|\W|$)/x
             else
                 /(#{rcq})
                 (#{C})

Maybe this should be reported upstream?

The regex used only matches the markers following (or before) spaces, when instead it's better to mark after any non-word character.

Hope this helps

Philip

Actions

Also available in: Atom PDF