Closed huber-florian closed 1 year ago
Hi @huber-florian,
Thanks for reporting this issue. It is a side-effect of re-implementing the Markdown rendering with SwiftUI primitives. I have some ideas to fix it for this particular use case. Unfortunately, other use cases, like images inside links with inline text, are impossible to fix until Apple correctly supports images in AttributedString
.
Hi @huber-florian,
The fix for this issue is now available in the main branch. Please take a look at the Demo project in the Images and Image Providers screens for the inline image support and the new markdownInlineImageProvider
modifier.
Thank you @gonzalezreal ! It works like a charm.
Describe the bug Prior to the newest major release, it was possible to embed images directly in the text. Since the major update it does not work any more.
Checklist
main
branch of this package.Steps to reproduce Markdown("2.\n\n \n\nContext Class (2 of 2 tests passing) ").markdownImageProvider(.asset) Markdown("2.\n \n\nContext Class (2 of 2 tests passing) ").markdownImageProvider(.asset) Markdown("2.\n\n \nContext Class (2 of 2 tests passing) ").markdownImageProvider(.asset) Markdown("2. Context Class (2 of 2 tests passing) ").markdownImageProvider(.asset) Markdown("2. Context Class (2 of 2 tests passing) ").markdownImageProvider(.asset) Markdown("2. Context Class (2 of 2 tests passing) ").markdownImageProvider(.asset)
(The "This is" part from above: ! [This is] (TestFailedSymbol) )(without spaces!) (The last 3 statements have a different amount of whitespaces to test if that changes something.)
Expected behavior The expected behavior would be that in all six cases the TestFailedSymbol is shown. (Works also with the dog image of the given example.) But only in the first two cases the image is shown. The second screenshot shows that it was possible to embed an image within the text prior to this major update.
Screenshots Experiments now (version 2.0.0):
Well working solution before (version 1.x):
Version information