プロジェクト

全般

プロフィール

Vote #78642

完了

Text formatting not applied to commit messages even if enabled in settings

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

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

0%

予定工数:
category_id:
10
version_id:
132
issue_org_id:
26445
author_id:
139457
assigned_to_id:
1
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
130
ステータス-->[Closed]

説明

Hello,

The option textile rendering of the commit messages is enabled.
The messages are shown as formatted but the commits aren't rendered in markdown or textile.

I looked through the commit r16062 of #22758:


    if options[:formatting] == false
      text = h(text)
    else
      formatting = options[:formatting] || Setting.text_formatting
      text = Redmine::WikiFormatting.to_html(formatting, text, :object => obj, :attribute => attr)
    end

For me it seem that the doubled @options[:formatting]@ in the @if@ and @else@ part make no sense.
Because of the lazy evaluation the @Setting.text_formatting@ isn't evaluated at all.

I changed the code to:


    if options[:formatting] == false
      text = h(text)
    else
      text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr)
    end

And now the comments are correctly rendered again.


journals

Or other way around would make sense.
If the system setting is set to false, the text would still be formatted.
<pre><code class="ruby">
if options[:formatting] == false
text = h(text)
else
formatting = Setting.text_formatting || options[:formatting]
text = Redmine::WikiFormatting.to_html(formatting, text, :object => obj, :attribute => attr)
end
</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Nils Grimm wrote:
> Or other way around would make sense.
> If the system setting is set to false, the text would still be formatted.
> [...]

I think your description is good enough because "format = true/false" is non sense.

--------------------------------------------------------------------------------
Fix committed, thanks for pointing this out.
--------------------------------------------------------------------------------

Admin Redmine さんが4年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン3.4.2_132 にセット

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

いいね!0
いいね!0