From 92060ff43dfd75b9dbfde987b3cf9c5ad6000684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Sun, 2 Oct 2022 14:40:19 +0200 Subject: [PATCH] Fix: #570 and https://github.com/pillar-markup/pillar/issues/574 Next write a nice test! --- src/Microdown/MicRootBlock.class.st | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Microdown/MicRootBlock.class.st b/src/Microdown/MicRootBlock.class.st index 68c66d01..0c60bf2e 100644 --- a/src/Microdown/MicRootBlock.class.st +++ b/src/Microdown/MicRootBlock.class.st @@ -76,6 +76,13 @@ MicRootBlock >> properties: aConfigurationForPillar [ MicRootBlock >> transformDocumentFor: aPRPDFDocument [ "This is a hook to be able to have framework specific transformation hooks. see PRAbstractOutputDocument>>#buildOn:" - - ^ aPRPDFDocument transformDocument: (self resolveFrom: aPRPDFDocument project baseDirectory asMicResourceReference ) + "Note that the resolution is made against the currently transformed file and not the base directory of the project else we may lose the fact that a figure is within multiple folders within the base project. + Compare + /base and + /base/Chapters/Chapter1/FileContainingAReferenceToFigures.md + When resolving figures/myPng referenced from within FileContainingAReferenceToFigures.md + we should get /base/Chapters/Chapter1/figures/myPng! + Using base we lose Chapters/Chapter1 and only get /base/figures/myPng. + " + ^ aPRPDFDocument transformDocument: (self resolveFrom: aPRPDFDocument file file asMicResourceReference ) ]