From c3f469374a49dae44bf9605504b7853d23f3636e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 31 Oct 2023 16:57:42 +1100 Subject: [PATCH] fix broken links in extension references done by [[[]]] --- .../java/org/hl7/fhir/r5/renderers/DataRenderer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 88adf4f63..2627640dd 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -161,9 +161,17 @@ public class DataRenderer extends Renderer implements CodeResolver { if (p == null) p = getContext().getWorker().fetchResource(StructureDefinition.class, link); if (p != null) { + if ("Extension".equals(p.getType())) { + path = null; + } else if (p.hasSnapshot()) { + path = p.getSnapshot().getElementFirstRep().getPath(); + } else if (Utilities.isAbsoluteUrl(path)) { + path = null; + } url = p.getWebPath(); - if (url == null) + if (url == null) { url = p.getUserString("filename"); + } } else throw new DefinitionException("Unable to resolve markdown link "+link);