Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-08-15 18:33:04 +0000
committerspingel2008-08-15 18:33:04 +0000
commitf7a0decd17827c154cfddf9936bd863f681dffbc (patch)
treec0cd86e94baee4e7c5a1b6a700cf1a0453928721 /org.eclipse.mylyn.trac.ui
parent89a18d824839eafdee65fdd0cf77132196126b36 (diff)
downloadorg.eclipse.mylyn.tasks-f7a0decd17827c154cfddf9936bd863f681dffbc.tar.gz
org.eclipse.mylyn.tasks-f7a0decd17827c154cfddf9936bd863f681dffbc.tar.xz
org.eclipse.mylyn.tasks-f7a0decd17827c154cfddf9936bd863f681dffbc.zip
NEW - bug 244017: Hyperlinking support for Trac should handle disabled (escaped) links.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244017 NEW - bug 244017: Hyperlinking support for Trac should handle disabled (escaped) links. https://bugs.eclipse.org/bugs/show_bug.cgi?id=244017
Diffstat (limited to 'org.eclipse.mylyn.trac.ui')
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtil.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtil.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtil.java
index cea57af85..629a85011 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtil.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkUtil.java
@@ -28,6 +28,7 @@ import org.eclipse.mylyn.tasks.ui.TaskHyperlink;
* Utility class for detecting Trac hyperlinks.
*
* @author Steffen Pingel
+ * @author David Green fix for bug 244017
*/
public class TracHyperlinkUtil {
@@ -41,7 +42,7 @@ public class TracHyperlinkUtil {
static Pattern changesetPattern1 = Pattern.compile("(r|changeset:)(\\d+)(/\\w+)?");
- static Pattern changesetPattern2 = Pattern.compile("\\[(\\d+)(/\\w+)?\\]");
+ static Pattern changesetPattern2 = Pattern.compile("(?<![!])\\[(\\d+)(/\\w+)?\\]");
static Pattern revisionLogPattern1 = Pattern.compile("r(\\d+):(\\d+)");
@@ -55,7 +56,7 @@ public class TracHyperlinkUtil {
static Pattern wikiPattern1 = Pattern.compile("wiki:(\\w+)");
- static Pattern wikiPattern2 = Pattern.compile("[A-Z][a-z0-9]+[A-Z]\\w*");
+ static Pattern wikiPattern2 = Pattern.compile("(?<![!])[A-Z][a-z0-9]+[A-Z]\\w*");
static Pattern milestonePattern = Pattern.compile("milestone:([\\w\\.]+)");
@@ -146,8 +147,8 @@ public class TracHyperlinkUtil {
if (isInRegion(lineOffset, m)) {
String rev = m.group(1);
String stopRev = m.group(2);
- String url = repository.getRepositoryUrl() + ITracClient.REVISION_LOG_URL + "?rev=" + rev + "&stop_rev="
- + stopRev;
+ String url = repository.getRepositoryUrl() + ITracClient.REVISION_LOG_URL + "?rev=" + rev
+ + "&stop_rev=" + stopRev;
links.add(new WebHyperlink(determineRegion(regionOffset, m), url));
}
}
@@ -157,8 +158,8 @@ public class TracHyperlinkUtil {
if (isInRegion(lineOffset, m)) {
String rev = m.group(1);
String stopRev = m.group(2);
- String url = repository.getRepositoryUrl() + ITracClient.REVISION_LOG_URL + "?rev=" + rev + "&stop_rev="
- + stopRev;
+ String url = repository.getRepositoryUrl() + ITracClient.REVISION_LOG_URL + "?rev=" + rev
+ + "&stop_rev=" + stopRev;
links.add(new WebHyperlink(determineRegion(regionOffset, m), url));
}
}
@@ -244,8 +245,8 @@ public class TracHyperlinkUtil {
while (m.find()) {
if (isInRegion(lineOffset, m)) {
String page = m.group(1);
- links.add(new WebHyperlink(determineRegion(regionOffset, m), repository.getRepositoryUrl() + ITracClient.WIKI_URL
- + page));
+ links.add(new WebHyperlink(determineRegion(regionOffset, m), repository.getRepositoryUrl()
+ + ITracClient.WIKI_URL + page));
}
}
@@ -253,8 +254,8 @@ public class TracHyperlinkUtil {
while (m.find()) {
if (isInRegion(lineOffset, m)) {
String page = m.group(0);
- links.add(new WebHyperlink(determineRegion(regionOffset, m), repository.getRepositoryUrl() + ITracClient.WIKI_URL
- + page));
+ links.add(new WebHyperlink(determineRegion(regionOffset, m), repository.getRepositoryUrl()
+ + ITracClient.WIKI_URL + page));
}
}

Back to the top