As all diagrams are created in book/img we need to ensure that the
browser always fetch the images from /img/.
If we don't specify that images are served from the root, the browser
will expect to a "img" directory to exist at each sub-path.
Use case: Books organised as //, the diagram will be
created in /img. So adding the slash to indicate that img is served from
the root makes the browser look for the right path, regardless of which level
the diagram is.
I wasn't able to easily create a test for it since it would require the file
rendering to be successful to get to the code where the path is generated. If
you have tips on how I can do it, I'm happy to add 😃
As all diagrams are created in/img/.
book/img
we need to ensure that the browser always fetch the images fromIf we don't specify that images are served from the root, the browser will expect to a "img" directory to exist at each sub-path.
Use case: Books organised as//, the diagram will be
created in /img. So adding the slash to indicate that img is served from
the root makes the browser look for the right path, regardless of which level
the diagram is.
I wasn't able to easily create a test for it since it would require the file rendering to be successful to get to the code where the path is generated. If you have tips on how I can do it, I'm happy to add 😃