プロジェクト

全般

プロフィール

Vote #78813

完了

Links on custom field values don't have "external" class

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

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

0%

予定工数:
category_id:
14
version_id:
99
issue_org_id:
27024
author_id:
332
assigned_to_id:
332
comments:
6
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Textile and Markdown formatter in Redmine adds "external" class to @a@ element when rendering links to an external site. Here is an exmaple:

Textile:

"Redmine":http://www.redmine.org/

Rendered HTML:


Although those formatters adds "external" class like as above, links on custom field values, which can be configured in "Link values to URL" of custom fields, don't have "external" class. I am in trouble with this behavior because I use UI theme that provides JavaScript code which opens external link in a new browser window (please see https://github.com/farend/redmine_theme_farend_basic/blob/master/javascripts/theme.js#L3).

I think that links on custom field should have "external" class for consistency and convenience. Attaching a patch to fix this.


journals

--------------------------------------------------------------------------------
Sorry, replaced the patch. The previous patch contained irrelevant codes.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
LGTM :)
I tested Go MAEDA's patch on the Latest trunk@17038.
--------------------------------------------------------------------------------
Attaching an updated patch. Fixed test failure.

<pre>
Failure:
Redmine::ListFieldFormatTest#test_field_with_url_pattern_and_multiple_values_should_link_values [test/unit/lib/redmine/field_format/list_format_test.rb:141]:
--- expected
+++ actual
@@ -1 +1 @@
-"<a class=\"external\" href=\"http://localhost/bar\">bar</a>, <a href=\"http://localhost/foo\">foo</a>"
+"<a class=\"external\" href=\"http://localhost/bar\">bar</a>, <a class=\"external\" href=\"http://localhost/foo\">foo</a>"

bin/rails test test/unit/lib/redmine/field_format/list_format_test.rb:138
</pre>
--------------------------------------------------------------------------------
Committed.
--------------------------------------------------------------------------------

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

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

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

いいね!0
いいね!0