提交 489a3607 编写于 作者: O Oliver Gondža

[FIXED JENKINS-19866] Merge pull request #1003 from ewongbb/jenkins_19866

......@@ -69,6 +69,9 @@ Upcoming changes</a>
<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=-->
......
......@@ -40,7 +40,7 @@ public class UrlAnnotator extends ConsoleAnnotatorFactory<Object> {
* 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= "'\")(][><";
......
......@@ -56,5 +56,9 @@ public class UrlAnnotatorTest extends TestCase {
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));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册