Defect #26443
closedUser link syntax (user:login) doesn't work for logins consisting of an email adress
0%
Description
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
Files
Related issues
Updated by Mischa The Evil over 7 years ago
- Related to Feature #4179: Link to user in wiki syntax added
Updated by Marius BĂLTEANU over 7 years ago
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.
Updated by Marius BĂLTEANU over 7 years ago
- File 26443_fix_user_link_syntax.patch added
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 The Evil, 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?
Updated by Go MAEDA over 7 years ago
- Target version set to 3.4.3
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.
Updated by Go MAEDA over 7 years ago
- Blocks Defect #26507: "attachment:filename" link syntax would not work if the file name contains "@" added
Updated by Jean-Philippe Lang over 7 years ago
- Assignee set to Marius BĂLTEANU
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.
Updated by Marius BĂLTEANU over 7 years ago
- File 26443_fix_user_link_syntax.patch added
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).
Updated by Marius BĂLTEANU over 7 years ago
- File deleted (
26443_fix_user_link_syntax.patch)
Updated by Marius BĂLTEANU over 7 years ago
Attached the correct patch. The previous one has an undesired change.
Updated by Marius BĂLTEANU over 7 years ago
- File 26443_fix_user_link_syntax.patch added
Updated by Marius BĂLTEANU over 7 years ago
- File deleted (
26443_fix_user_link_syntax.patch)
Updated by Marius BĂLTEANU about 7 years ago
Just a technical note: An interesting approach is the 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 :)
Updated by Jean-Philippe Lang about 7 years ago
- Target version changed from 3.4.3 to 4.0.0
Changes are rather large, setting target to a major version.
Updated by Marius BĂLTEANU over 6 years ago
- File deleted (
26443_fix_user_link_syntax.patch)
Updated by Marius BĂLTEANU over 6 years ago
Updated the patch to apply cleanly against current trunk (r17286).
Updated by Marius BĂLTEANU over 6 years ago
- Blocks Defect #26892: Link to user in wiki syntax only works when login is written in lower case added
Updated by Jean-Philippe Lang over 6 years ago
- Status changed from Confirmed to Closed
- Resolution set to Fixed
Patch committed, thanks Marius.
Marius BALTEANU wrote:
Just a technical note: An interesting approach is the 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.