mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-22 00:05:31 +00:00
reducing the visibility of the markup
This commit is contained in:
1 parent
2f7fbafdd7
commit
2d05008d7e
3 files changed
+31
-8
No files matched your search
@@ -86,6 +86,16 @@ public abstract class AbstractMarkupText {
|
||||
addMarkup(startPos,endPos,"<a href='"+url+"'>","</a>");
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts an A tag that surrounds the given position.
|
||||
* But this hyperlink is less visible.
|
||||
*
|
||||
* @since 1.395
|
||||
*/
|
||||
public void addHyperlinkLowKey( int startPos, int endPos, String url ) {
|
||||
addMarkup(startPos,endPos,"<a class='lowkey' href='"+url+"'>","</a>");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a start tag and end tag around the entire text
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,7 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
|
||||
else
|
||||
return null; // unexpected format. abort.
|
||||
}
|
||||
text.addHyperlink(charPos,end,annotateClassName(line.substring(charPos,end)));
|
||||
text.addHyperlinkLowKey(charPos,end,annotateClassName(line.substring(charPos,end)));
|
||||
|
||||
return new ConsoleAnnotator() {
|
||||
public ConsoleAnnotator annotate(Object context, MarkupText text) {
|
||||
@@ -40,7 +40,7 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
|
||||
|
||||
Matcher m = STACK_TRACE_ELEMENT.matcher(line);
|
||||
if (m.find()) {// allow the match to happen in the middle of a line to cope with prefix. Ant and Maven put them, among many other tools.
|
||||
text.addHyperlink(m.start()+4,m.end(),annotateMethodName(m.group(1),m.group(2),m.group(3),Integer.parseInt(m.group(4))));
|
||||
text.addHyperlinkLowKey(m.start()+4,m.end(),annotateMethodName(m.group(1),m.group(2),m.group(3),Integer.parseInt(m.group(4))));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
|
||||
int s = idx + CAUSED_BY.length();
|
||||
int e = line.indexOf(':', s);
|
||||
if (e<0) e = line.length();
|
||||
text.addHyperlink(s,e,annotateClassName(line.substring(s,e)));
|
||||
text.addHyperlinkLowKey(s,e,annotateClassName(line.substring(s,e)));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -65,13 +65,11 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
|
||||
// TODO; separate out the annotations and mark up
|
||||
|
||||
private String annotateMethodName(String className, String methodName, String sourceFileName, int lineNumber) {
|
||||
// for now
|
||||
return "http://grepcode.com/search/?query="+className+'.'+methodName+"&entity=method";
|
||||
return "http://stacktrace.hudson-labs.org/search/?query="+className+'.'+methodName+"&entity=method";
|
||||
}
|
||||
|
||||
private String annotateClassName(String className) {
|
||||
// for now
|
||||
return "http://grepcode.com/search?query="+className;
|
||||
return "http://stacktrace.hudson-labs.org/search?query="+className;
|
||||
}
|
||||
|
||||
@Extension
|
||||
@@ -97,5 +95,5 @@ public class HudsonExceptionNote extends ConsoleNote<Object> {
|
||||
|
||||
private static final String CAUSED_BY = "Caused by: ";
|
||||
|
||||
private static final Pattern AND_MORE = Pattern.compile("\t... [0-9]+ more");
|
||||
private static final Pattern AND_MORE = Pattern.compile("\t... [0-9]+ more\n");
|
||||
}
|
||||
Reference in new issue
Block a user