Defect #26445

Updated by Toshi MARUYAMA 3 months ago

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 r16002 of #22758:

<pre><code class="ruby">
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
</code></pre>

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:
<pre><code class="ruby">
if options[:formatting] == false
text = h(text)
else
text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr)
end
</code></pre>

And now the comments are correctly rendered again.

Back