Closed codebeauty closed 3 years ago
MarkdownUI can render local images, provided that they can be located inside the bundle using a URL. This means that the image cannot be inside an asset catalog, and that you will need to set the markdown base URL to the bundle's resource URL. For example:
Markdown(
#"""
This is a local image:
![Dog](dog.jpg)
"""#
)
.markdownBaseURL(Bundle.main.resourceURL)
@gonzalezreal Also from my side thanks for MarkdownUI.
But could we not somehow define a sub folder of the base url for the images ? I want todo my dynamic help system with MarkdownUI and putting like 20-30 images into the main resource folder would mess up my project big time ... .
You could put the images in a separate bundle, and set the base URL to that bundle's resource URL. There is also some work in progress to support asset catalog images in #48. You may want to keep an eye on that.
Thank you for the clarification and keep up the great work ๐งก
Great library. Before I want to dive deeper into it, one question. Do you support local images? I see your example with an remote image. Is it possible to link a local image? Maybe from the asset bundle?
Thank you for your work. ๐