summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine
diff options
context:
space:
mode:
Diffstat (limited to 'org/madore/damlengine')
-rw-r--r--org/madore/damlengine/TodoWrefAttr.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org/madore/damlengine/TodoWrefAttr.java b/org/madore/damlengine/TodoWrefAttr.java
index 9f33406..95583e4 100644
--- a/org/madore/damlengine/TodoWrefAttr.java
+++ b/org/madore/damlengine/TodoWrefAttr.java
@@ -33,10 +33,12 @@ public class TodoWrefAttr extends TodoAttr {
String wrefNumberStr = wrefMatcher.group(4);
String wrefSupplementStr = wrefMatcher.group(5);
String targetFile = "";
+ boolean isLocal = false;
if ( ctx.wsc != null && ctx.wsc.sel != null
- && ctx.wsc.sel.contains(new Integer(wrefNumberStr)) )
+ && ctx.wsc.sel.contains(new Integer(wrefNumberStr)) ) {
+ isLocal = true;
targetFile = "";
- else
+ } else
targetFile = ((ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"))
+ wrefYearStr + "-" + wrefMonthStr + ".html";
String targetFragment = "d." + wrefYearStr + "-" + wrefMonthStr
@@ -53,11 +55,12 @@ public class TodoWrefAttr extends TodoAttr {
.equals(esum.date)) )
throw new IllegalArgumentException("date mismatch for reference to entry "+wrefNumberStr);
if ( esum.doSinglePage != null
- && ! wrefSupplementStr.equals("")
+ && ! ( wrefSupplementStr.equals("")
+ && isLocal )
// Note to self: remember we could be called from d:wxref
// because of link on "older entries": we don't want
// to link to single entry page in this case. :-\
- && ! ( ctx.wsc instanceof Context.WeblogSingleSelectionContext ) ) {
+ && ! ( caller instanceof TodoWXrefAttr ) ) {
targetFile = ((ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"))
+ esum.date + "-" + esum.doSinglePage + ".html";
target = targetFile + "#" + targetFragment;