プロジェクト

全般

プロフィール

Vote #79059

完了

Image filename for HDPI monitors (image@2x.jpg) are misrecognized as email address

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

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

0%

予定工数:
category_id:
26
version_id:
99
issue_org_id:
27968
author_id:
332
assigned_to_id:
1
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Image files for HDMI monitors (e.g., MacBook Pro Retina monitors) usually have "@2x" suffix in their filename, like "logo@2x.png". If you write such filenames in issues or wiki pages, Redmine misrecognizes them as email addresses and they will have useless "mailto:" link.

Example:

logo@2x.png

is rendered as

"logo@2x.png"

journals

--------------------------------------------------------------------------------
Go Maeda, what do you think about restoring only the following patterns: (.*@2x\.(png|jpg|gif|jpeg))?

In this way, formats like:
- logo@2x.png: it'll be restored to string
- logo@2x.us: it'll link to mailto:logo@2x.us
- logo@2x.jpg: it'll be restored to string
- logo@2x.gif: it'll be restored to string
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Go Maeda, what do you think about restoring only the following patterns: (.*@2x\.(png|jpg|gif|jpeg))?

I think more image extensions such as "bmp" and "jpe" should be supported. Please see source:tags/3.4.5/app/helpers/application_helper.rb#L713

<pre><code class="ruby">
def parse_hires_images(text, project, obj, attr, only_path, options)
text.gsub!(/src="([^"]+@(\dx)\.(bmp|gif|jpg|jpe|jpeg|png))"/i) do |m|
filename, dpr = $1, $2
m + " srcset=\"#{filename} #{dpr}\""
end
end
</code></pre>
--------------------------------------------------------------------------------
Go MAEDA wrote:
> I think more image extensions such as "bmp" and "jpe" should be supported. Please see source:tags/3.4.5/app/helpers/application_helper.rb#L713
>
> [...]

Perfect, thanks for pointing me to that line, I didn't know about it.
--------------------------------------------------------------------------------
Attached a patch that fixes this issue. It should be applied after the fix from #26507.

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

--------------------------------------------------------------------------------
Patch committed, thanks Marius.
--------------------------------------------------------------------------------


related_issues

relates,Closed,26507,"attachment:filename" link syntax would not work if the file name contains "@"

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

  • カテゴリText formatting_26 にセット
  • 対象バージョン4.0.0_99 にセット

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

いいね!0
いいね!0