Project

General

Profile

Actions

Defect #26443

closed

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

Added by Mischa The Evil almost 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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

Related to Redmine - Feature #4179: Link to user in wiki syntaxClosedJean-Philippe Lang2009-11-08

Actions
Blocks Redmine - Defect #26507: "attachment:filename" link syntax would not work if the file name contains "@"ClosedJean-Philippe Lang

Actions
Blocks Redmine - Defect #26892: Link to user in wiki syntax only works when login is written in lower caseClosedJean-Philippe Lang

Actions
Actions #1

Updated by Mischa The Evil almost 7 years ago

Actions #2

Updated by Marius BĂLTEANU almost 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 ) 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.

Actions #3

Updated by Marius BĂLTEANU almost 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:"".
@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?

Actions #4

Updated by Go MAEDA almost 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.

Actions #5

Updated by Go MAEDA almost 7 years ago

  • Blocks Defect #26507: "attachment:filename" link syntax would not work if the file name contains "@" added
Actions #6

Updated by Jean-Philippe Lang over 6 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.

Actions #7

Updated by Marius BĂLTEANU over 6 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).

Actions #8

Updated by Marius BĂLTEANU over 6 years ago

  • File deleted (26443_fix_user_link_syntax.patch)
Actions #9

Updated by Marius BĂLTEANU over 6 years ago

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

Actions #10

Updated by Marius BĂLTEANU over 6 years ago

  • File 26443_fix_user_link_syntax.patch added
Actions #11

Updated by Marius BĂLTEANU over 6 years ago

  • File deleted (26443_fix_user_link_syntax.patch)
Actions #12

Updated by Marius BĂLTEANU over 6 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 :)

Actions #13

Updated by Jean-Philippe Lang over 6 years ago

  • Target version changed from 3.4.3 to 4.0.0

Changes are rather large, setting target to a major version.

Actions #14

Updated by Marius BĂLTEANU about 6 years ago

  • File deleted (26443_fix_user_link_syntax.patch)
Actions #15

Updated by Marius BĂLTEANU about 6 years ago

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

Actions #16

Updated by Marius BĂLTEANU about 6 years ago

  • Blocks Defect #26892: Link to user in wiki syntax only works when login is written in lower case added
Actions #17

Updated by Jean-Philippe Lang almost 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.

Actions

Also available in: Atom PDF