| Summary: | hyperlink detector does not check word boundaries | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Steffen Pingel <steffen.pingel> | ||||||||||||||
| Component: | Mylyn | Assignee: | Frank Becker <eclipse> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | normal | ||||||||||||||||
| Priority: | P3 | CC: | robert.elves | ||||||||||||||
| Version: | unspecified | ||||||||||||||||
| Target Milestone: | 3.3.2 | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Linux | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Steffen Pingel
Created attachment 151652 [details]
commited patch
Created attachment 151653 [details]
mylyn/context/zip
patch is commited bug and task must have a leading space. Hyperlink detection now fails if there is no space before "bug", e.g. if it's on a new line: bug 123 We should also add a few test cases to BugzillaTaskHyperlinkTest to make sure we have this case and the cases mentioned in the description covered. Created attachment 151735 [details] new patch (In reply to comment #4) > Hyperlink detection now fails if there is no space before "bug", e.g. if it's > on a new line: > bug 123 > > We should also add a few test cases to BugzillaTaskHyperlinkTest to make sure > we have this case and the cases mentioned in the description covered. OK I now change the regexp so that withespace and linestart can be before bug and task. Steffen, do you want to verify this before commit? Created attachment 151736 [details]
mylyn/context/zip
This looks better but there is some duplication in the regexp now and we are missing a bunch of cases, e.g. if other characters such as ":" "," "." are used before "bug". (In reply to comment #7) > This looks better but there is some duplication in the regexp now and we are > missing a bunch of cases, e.g. if other characters such as ":" "," "." are used > before "bug". Should I use (\\W|^)+ for matching linestart or any non wordcharacter and not (\\s|^)+ for matching linestart or whitespace. Yes, you could try that. Just make sure that we have test cases to test for common cases, I am not sure how word boundaries are defined exactly. You could try \p{Punct} or specify a list of separators.
Created attachment 154709 [details]
commited patch
Created attachment 154710 [details]
mylyn/context/zip
patch is now in HEAD |