summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/TodoWrefAttr.java
diff options
context:
space:
mode:
Diffstat (limited to 'org/madore/damlengine/TodoWrefAttr.java')
-rw-r--r--org/madore/damlengine/TodoWrefAttr.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/org/madore/damlengine/TodoWrefAttr.java b/org/madore/damlengine/TodoWrefAttr.java
index 9341919..b707a95 100644
--- a/org/madore/damlengine/TodoWrefAttr.java
+++ b/org/madore/damlengine/TodoWrefAttr.java
@@ -54,13 +54,16 @@ public class TodoWrefAttr extends TodoAttr {
if ( ! ((wrefYearStr+"-"+wrefMonthStr+"-"+wrefDayStr)
.equals(esum.date)) )
throw new IllegalArgumentException("date mismatch for reference to entry "+wrefNumberStr);
- if ( wrefCat != null ) {
+ if ( wrefCat != null && ! wrefCat.equals("@month") ) {
if ( esum.catSet == null || ! esum.catSet.contains(wrefCat) )
throw new IllegalArgumentException("reference to entry "+wrefNumberStr+" in wrong category "+wrefCat);
}
}
// Choose file portion of link target
if ( esum != null && esum.doSinglePage != null && ! wrefSupplementStr.equals("") ) {
+ // Linking to a _fragment_ of an entry that has a single page.
+ if ( wrefCat != null )
+ System.err.println("warning: ignoring d:wrefcat attribute!");
if ( ctx.wsc != null && ctx.wsc.sel != null
&& ctx.wsc instanceof Context.WeblogSingleSelectionContext
&& ((Context.WeblogSingleSelectionContext)ctx.wsc).number == wrefNumber )
@@ -69,16 +72,18 @@ public class TodoWrefAttr extends TodoAttr {
targetFile = targetStdDir + esum.date + "-" + esum.doSinglePage + ".html";
} else if ( ctx.wsc != null && ctx.wsc.sel != null
&& ctx.wsc.sel.contains(wrefNumber) ) {
+ // Linking to an entry already present on this page.
targetFile = "";
- } else if ( wrefCat != null ) {
+ } else if ( wrefCat != null && ! wrefCat.equals("@month") ) {
+ // Linking to an entry in a designated category.
targetFile = targetStdDir + wrefCat + ".html";
} else {
+ // Linking to an entry in its month, or single page.
targetFile = targetStdDir + wrefYearStr + "-" + wrefMonthStr + ".html";
if ( esum != null && esum.doSinglePage != null
// 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. :-\
- && ! ( caller instanceof TodoWXrefAttr ) ) {
+ // because of link on "older entries".
+ && ( wrefCat == null || ! wrefCat.equals("@month") ) ) {
targetFile = targetStdDir + esum.date + "-" + esum.doSinglePage + ".html";
}
}