improved the handling of URL enclosed in "..." or <...> (or others like that)

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29261 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-03-26 01:24:42 +00:00
1 parent 393adbf667
commit f3ad3ab4be
3 files changed
+45 -1

No files matched your search

+22
View File
@@ -89,6 +89,18 @@ public class MarkupText extends AbstractMarkupText {
}
}
public SubText(int start, int end) {
this.start = start;
this.end = end;
groups = new int[0];
}
@Override
public SubText subText(int start, int end) {
return MarkupText.this.subText(this.start+start,
end<0 ? this.end+1+end : this.end+end);
}
@Override
public String getText() {
return text.substring(start,end);
@@ -224,6 +236,16 @@ public class MarkupText extends AbstractMarkupText {
return text;
}
/**
* Returns a subtext.
*
* @param end
* If negative, -N means "trim the last N-1 chars". That is, (s,-1) is the same as (s,length)
*/
public SubText subText(int start, int end) {
return new SubText(start, end<0 ? text.length()+1+end : end);
}
@Override
public void addMarkup( int startPos, int endPos, String startTag, String endTag ) {
rangeCheck(startPos);