fix broken links in extension references done by [[[]]]

This commit is contained in:
Grahame Grieve 2023-10-31 16:57:42 +11:00
parent 809b2f68ea
commit c3f469374a
1 changed files with 9 additions and 1 deletions

View File

@ -161,9 +161,17 @@ public class DataRenderer extends Renderer implements CodeResolver {
if (p == null) if (p == null)
p = getContext().getWorker().fetchResource(StructureDefinition.class, link); p = getContext().getWorker().fetchResource(StructureDefinition.class, link);
if (p != null) { 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(); url = p.getWebPath();
if (url == null) if (url == null) {
url = p.getUserString("filename"); url = p.getUserString("filename");
}
} else } else
throw new DefinitionException("Unable to resolve markdown link "+link); throw new DefinitionException("Unable to resolve markdown link "+link);