fix problem rendering canonical URLs with | in them

This commit is contained in:
Grahame Grieve 2020-11-11 10:04:02 +11:00
parent 476924e1cb
commit 3b74c39de4
1 changed files with 9 additions and 4 deletions

View File

@ -392,12 +392,17 @@ public class DataRenderer extends Renderer {
} else if (!getContext().isCanonicalUrlsAsLinks())
url = null;
}
if (url == null)
if (url == null) {
x.b().tx(uri.getValue());
else if (uri.getValue().startsWith("mailto:"))
} else if (uri.getValue().startsWith("mailto:")) {
x.ah(uri.getValue()).addText(uri.getValue().substring(7));
else
x.ah(uri.getValue()).addText(uri.getValue());
} else {
if (uri.getValue().contains("|")) {
x.ah(uri.getValue().substring(0, uri.getValue().indexOf("|"))).addText(uri.getValue());
} else {
x.ah(uri.getValue()).addText(uri.getValue());
}
}
}
protected void renderAnnotation(XhtmlNode x, Annotation annot) {