プロジェクト

全般

プロフィール

Vote #70797

未完了

<br /> is not inserted before macro in Wiki

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

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

0%

予定工数:
category_id:
26
version_id:
0
issue_org_id:
9377
author_id:
37792
assigned_to_id:
0
comments:
6
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
35
ステータス-->[New]

説明


tag is not inserted before macros in Wiki.

For example,

abc
!{{hello_world}}

should be converted to

abc
Hello world! Object: Journal, Called with no argument.

However, it is converted to

abc Hello world! Object: Journal, Called with no argument.

Detail and cause:

in Wiki is inserted by @hard_break@ method in "lib/redmine/wiki_formatting/textile/formatter.rb".
This method replaces "\n" with "
" as follows:

          text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
" ) if hard_breaks

It seems that "[{|]" prevents insertion of "
" before CSS style and in table, because CSS style in Wiki starts with "{" and cells of table are separated by "|".
Macros in Wiki also start with double "{"s, so "
" is not inserted before macros.
I think that @hard_break@ method should be

          text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|\{[^{]|\|))/, "\\1
" ) if hard_breaks

to replace "\n" before macros.

Environment:

  • Redmine version 1.2.1
  • Ruby version 1.8.7 (patch 174)
  • Rails version 2.3.5

journals

I sent pull request in GitHub.
Please refer to https://github.com/edavis10/redmine/pull/44.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Please post the patch here.
--------------------------------------------------------------------------------
I post the patch.

I have already sent a pull request in GitHub.
If it confuses Redmine's contributors, please let me know about what to do.
--------------------------------------------------------------------------------
Masamitsu Murase wrote:
> If it confuses Redmine's contributors, please let me know about what to do.

It does, because GitHub repo is not an official one (check [[Contribute#Basic-process-for-contributing-code]]) and can potentially differ from the original source.

I think that Eric keep it up to date, though, but this may be not true.
--------------------------------------------------------------------------------
Thank you for your reply, Etienne Massip.

I close the pull request in GitHub to avoid confusion.
--------------------------------------------------------------------------------

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

  • カテゴリText formatting_26 にセット

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

いいね!0
いいね!0