diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java index d3b863d39..92a5651fe 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/AdditionalBindingsRenderer.java @@ -399,7 +399,7 @@ public class AdditionalBindingsRenderer { return; // what should happen? } BindingResolution br = pkp.resolveBinding(profile, b.getValueSet(), corePath); - XhtmlNode a = children.ah(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, b.hasDocumentation() ? b.getDocumentation() : null); + XhtmlNode a = children.ahOrCode(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !context.getPkp().prependLinks() ? br.url : corePath+br.url, b.hasDocumentation() ? b.getDocumentation() : null); if (b.hasDocumentation()) { a.attribute("title", b.getDocumentation()); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java index 75a9b456f..ee9b8ee5a 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlFluent.java @@ -121,6 +121,26 @@ public abstract class XhtmlFluent { return x; } + /** + * make it a code if it's not a link + * @param href + * @param title + * @return + */ + public XhtmlNode ahOrCode(String href, String title) { + if (href != null) { + return ah(href, title); + } else if (title != null) { + return code().setAttribute("title", title); + } else { + return code(); + } + } + + public XhtmlNode ahOrCode(String href) { + return ahOrCode(href, null); + } + public XhtmlNode img(String src, String alt) { return addTag("img").attribute("src", src).attribute("alt", alt); }