Defect #26445

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

Added by Nils Grimm 12 days ago. Updated 11 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:UI
Target version:3.4.2
Resolution:Fixed Affected version:3.4.1

Description

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.

Associated revisions

Revision 16823
Added by Jean-Philippe Lang 11 days ago

Fixed that formatting of commit message is never applied (#26445).

History

#1 Updated by Nils Grimm 12 days ago

Or other way around would make sense.
If the system setting is set to false, the text would still be formatted.

    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

#2 Updated by Toshi MARUYAMA 12 days ago

  • Description updated (diff)

#3 Updated by Toshi MARUYAMA 12 days ago

  • Target version set to 3.4.2

#4 Updated by Toshi MARUYAMA 12 days ago

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.

#5 Updated by Jean-Philippe Lang 11 days ago

  • Subject changed from Textile rendering for commit messages doesn't render textile to Text formatting not applied to commit messages even if enabled in settings
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fix committed, thanks for pointing this out.

Also available in: Atom PDF