プロジェクト

全般

プロフィール

Vote #79437

完了

Textile phrase modifiers break wiki macros

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

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
143
issue_org_id:
29247
author_id:
355817
assigned_to_id:
332
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
141
ステータス-->[Closed]

説明

redcloth.rb, Redmine's textile interpreter, has a long standing bug or "glitch". That glitch relates to using modifiers (bold, italic, underline, etc.) together with a macro.

*{{user(1)}}*

will not produce the desired result, namely a link to a user in bold face. Instead, it will produce a "}" in boldface like here: {{}}

I propose the following fix to lib/redmine/wiki_formatting/textile/redcloth3.rb:

346c346,347
<     C_STYL = '(?:\{[^"}]+\})'
---
> #   C_STYL = '(?:\{[^"}]+\})' 
>     C_STYL = '(?:\{[^{][^"}]+\})' 

The proposed fix will catch double curly brackets and still apply styles (boldface, underline, italic, etc.)


journals

Confirmed the issue in Textile mode. No problem in Markdown mode.

I added a test which can catch the issue to Stephan Wenzel's patch.
--------------------------------------------------------------------------------
*Disclaimer:* I don't know a lot about the inner workings of redcloth.

I can see, how the proposed change fixes the problem at hand. I assume it does not have negative side effects.

The @C_STYLE@ var seems to be used to match css style expressions, e.g. @p{background:red}. Red paragraph@. After the change, expressions that start with @{@ are no longer matched. This should not be a problem. As far as I can tell, @{@ will never appear at the beginning of such an expression.

That being said, I don't see a reason, to reject the proposed change.
--------------------------------------------------------------------------------
Gregor, thank you for reviewing the patch. I am setting the target version to 3.4.7.
--------------------------------------------------------------------------------
Committed. Thank you for your contribution.
--------------------------------------------------------------------------------

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

  • カテゴリText formatting_26 にセット
  • 対象バージョン3.4.7_143 にセット

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

いいね!0
いいね!0