プロジェクト

全般

プロフィール

Vote #63213

完了

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

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
開始日:
2008/05/12
期日:
進捗率:

0%

予定工数:
category_id:
1
version_id:
4
issue_org_id:
1225
author_id:
1017
assigned_to_id:
0
comments:
2
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
3
ステータス-->[Closed]

説明

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


journals

the sample line given was, of course wrong as I left out the thing causing the bug: The parentheses:

(_this should be italizised but is not_)

The patch is correct though :-)

Philip
--------------------------------------------------------------------------------
Fixed in r1434.
I didn't use \W since it would match too often, even when it's not wanted.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリWiki_1 にセット
  • 対象バージョン0.7.2_4 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0