summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/TodoCutHere.java
diff options
context:
space:
mode:
Diffstat (limited to 'org/madore/damlengine/TodoCutHere.java')
-rw-r--r--org/madore/damlengine/TodoCutHere.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/org/madore/damlengine/TodoCutHere.java b/org/madore/damlengine/TodoCutHere.java
index e935c4e..898c784 100644
--- a/org/madore/damlengine/TodoCutHere.java
+++ b/org/madore/damlengine/TodoCutHere.java
@@ -27,12 +27,15 @@ public final class TodoCutHere extends TodoDefaultElement {
throw new IllegalStateException("cut-here element found in non single-page entry");
String lang = LangHelper.getLangRec(node);
String explicitLang = LangHelper.getLangNorec(node);
+ final WeblogLink lk
+ = new WeblogLink(ctx.ent.year, ctx.ent.month,
+ ctx.ent.day, ctx.ent.number,
+ ".CUT", ctx.ent.doSinglePage);
+ lk.setTypeSingle();
if ( ctx.wsc == null
|| ctx.wsc instanceof Context.WeblogSingleSelectionContext ) {
Element div = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "div");
- div.setAttributeNS(null, "id",
- "d." + ctx.ent.date + "." + ctx.ent.number
- + ".CUT");
+ div.setAttributeNS(null, "id", lk.getFragment());
div.setAttributeNS(null, "class", "cut-anchor");
div.appendChild(ctx.doc.createComment(" EMPTY "));
node.getParentNode().replaceChild(div, node);
@@ -40,11 +43,8 @@ public final class TodoCutHere extends TodoDefaultElement {
Element p = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "p");
Element a = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "a");
p.appendChild(a);
- a.setAttributeNS(null, "href",
- ((ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"))
- + ctx.ent.date + "-" + ctx.ent.doSinglePage + ".html"
- + "#d." + ctx.ent.date + "." + ctx.ent.number
- + ".CUT");
+ final String baseDir = ((ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"));
+ a.setAttributeNS(null, "href", lk.getTarget(baseDir));
if ( explicitLang != null )
LangHelper.setLangNorec(p, explicitLang);
p.setAttributeNS(null, "class", "cut-link");