プロジェクト

全般

プロフィール

Vote #78640

完了

User link syntax (user:login) doesn't work for logins consisting of an email adress

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

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

0%

予定工数:
category_id:
26
version_id:
99
issue_org_id:
26443
author_id:
1565
assigned_to_id:
107353
comments:
17
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
119
ステータス-->[Closed]

説明

From #4179#note-69:

Vu Anh wrote:

Seem it isn't working well with syntax "@user:abc@example.com@" (Login name contain "@" character)

I am able to confirm this issue. Important to note though, is that the short syntax (@login) works as it should.

I'll attach a patch which adds explicit test coverage for this issue. It showcases what works and, after re-enabling the commented-out assertions, what currently fails.

Patch and confirmation against source:/trunk@16479 (though it is present on 3.4.1 too).

Environment:

Environment:
  Redmine version                3.4.0.devel@r16479
  Ruby version                   2.3.3-p222 (2016-11-21) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.8
  Git                            1.9.1
  Filesystem                     
Redmine plugins:
  no plugin installed

journals

--------------------------------------------------------------------------------
Thanks Mischa for opening this issue. I've already started work to a fix, but I found another issue (user logins with non alphanumeric characters like john.smith@foo.bar) on textile formatting and I need more time to fix all these issue. Unfortunately, only next week I'll have the time to continue work on this.
--------------------------------------------------------------------------------
The attached patch fixes both issues.

Because I couldn't modify the regex to ignore the emails that starts with "@" or "user:", I chose to use the same logic from markdown formatting also for textile.

@Mischa, when I've implemented this feature, I didn't take into consideration the format *user:"abcd@example.com"*.
@Jean-Philippe Lang, do you think that it'll be better to use the new method "restore_user_links!" also in the markdown/formatting.rb in order to avoid the almost duplicated regexes?
--------------------------------------------------------------------------------
The patch attached in #26443#note-3 fixes this issue properly on the current trunk and 3.4-stable.
Setting target version to 3.4.3.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Marius BALTEANU wrote:

> @Jean-Philippe Lang, do you think that it'll be better to use the new method "restore_user_links!" also in the markdown/formatting.rb in order to avoid the almost duplicated regexes?

That would be nice indeed if we can use the same method.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> That would be nice indeed if we can use the same method.

Here it is the new patch. I chose to move all the restore redmine links from markdown to the new method because I do not see any side effect.

I'll add a new patch soon that improves the existing tests in order to be sure that all redmine links work on each text formatting (none, textile, markdown).
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Attached the correct patch. The previous one has an undesired change.
--------------------------------------------------------------------------------

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

--------------------------------------------------------------------------------
Just a technical note: An interesting approach is the "html-pipeline":https://github.com/jch/html-pipeline used by GitHub which easily allows you to apply different filters or transformations over the initial html. I like that the implementation looks very clean. Jean-Philippe Lang, do you find this approach interesting for a future implementation in Redmine? I can work on this, but I want a validation first :)
--------------------------------------------------------------------------------
Changes are rather large, setting target to a major version.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Updated the patch to apply cleanly against current trunk (r17286).
--------------------------------------------------------------------------------

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

Marius BALTEANU wrote:
> Just a technical note: An interesting approach is the "html-pipeline":https://github.com/jch/html-pipeline used by GitHub which easily allows you to apply different filters or transformations over the initial html. I like that the implementation looks very clean. Jean-Philippe Lang, do you find this approach interesting for a future implementation in Redmine? I can work on this, but I want a validation first :)

It looks very interesting indeed. That would be nice to see how we could benefit to using it.
--------------------------------------------------------------------------------


related_issues

relates,Closed,4179,Link to user in wiki syntax
blocks,Closed,26507,"attachment:filename" link syntax would not work if the file name contains "@"
blocks,Closed,26892,Link to user in wiki syntax only works when login is written in lower case

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

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

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

いいね!0
いいね!0