Fix duplicated alt and title attributes for attached images in Textile formatter (#40650).

Patch by Katsuya HIDAKA (@hidakatsuya).


git-svn-id: https://svn.redmine.org/redmine/trunk@22845 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-05-24 02:52:32 +00:00
parent 9293b72a45
commit c9fda88a40
2 changed files with 19 additions and 8 deletions

View File

@@ -202,11 +202,11 @@ class ApplicationHelperTest < Redmine::HelperTest
attachments = Attachment.all
with_settings text_formatting: 'textile' do
# When alt text is set
assert_match %r[<img src=".+?" title="This is a logo" alt="This is a logo" loading=".+?" title="alt text" alt="alt text" />],
assert_match %r[<img src=".+?" title="alt text" alt="alt text" loading=".+?" />],
textilizable('!logo.gif(alt text)!', attachments: attachments)
# When alt text and style are set
assert_match %r[<img src=".+?" title="This is a logo" alt="This is a logo" loading=".+?" style="width:100px;" title="alt text" alt="alt text" />],
assert_match %r[<img src=".+?" title="alt text" alt="alt text" loading=".+?" style="width:100px;" />],
textilizable('!{width:100px}logo.gif(alt text)!', attachments: attachments)
# When alt text is not set