Skip to content

Commit

Permalink
[FIXED JENKINS-19866] Merge pull request #1003 from ewongbb/jenkins_1…
Browse files Browse the repository at this point in the history
…9866
  • Loading branch information
olivergondza committed Nov 8, 2013
2 parents dda58ed + 4bf5e15 commit 489a360
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -69,6 +69,9 @@
<li class=rfe>
Show different “up” link for jobs in folders.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20106">issue 20106</a>)
<li class=rfe>
Add log handling line beginning with 'file://' as URL.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19866">issue 19866</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/console/UrlAnnotator.java
Expand Up @@ -40,7 +40,7 @@ public ConsoleAnnotator annotate(Object context, MarkupText text) {
* In addition, the last character shouldn't be ',' ':', '"', etc, as often those things show up right next
* to URL in plain text (e.g., test="http://www.example.com/")
*/
private static final Pattern URL = Pattern.compile("\\b(http|https|ftp)://[^\\s<>]+[^\\s<>,\\.:\"'()\\[\\]=]");
private static final Pattern URL = Pattern.compile("\\b(http|https|file|ftp)://[^\\s<>]+[^\\s<>,\\.:\"'()\\[\\]=]");

private static final String OPEN = "'\"()[]<>";
private static final String CLOSE= "'\")(][><";
Expand Down
4 changes: 4 additions & 0 deletions core/src/test/java/hudson/console/UrlAnnotatorTest.java
Expand Up @@ -56,5 +56,9 @@ public void testAnnotate() {
text = new MarkupText("Punctuation: http://foo/.");
ca.annotate(null, text);
assertEquals("Punctuation: <a href='http://foo/'>http://foo/</a>.", text.toString(true));
text = new MarkupText("Get this file://here/in/this/folder/.");
ca.annotate(null, text);
assertEquals("Get this <a href='file://here/in/this/folder/'>file://here/in/this/folder/</a>.",
text.toString(true));
}
}

0 comments on commit 489a360

Please sign in to comment.