StanfordSpezi / SpeziOnboarding

Spezi Onboarding module to inform a user or retrieve consent for a study participation
https://swiftpackageindex.com/StanfordSpezi/SpeziOnboarding/documentation/
MIT License
11 stars 5 forks source link

Headings are not rendered for markdown consent documents #48

Closed vishnuravi closed 1 month ago

vishnuravi commented 3 months ago

Description

When consent documents are written in Markdown and used with SpeziOnboarding, headings are not rendered.

Reproduction

Create a new application from the SpeziTemplateApplication and add a Markdown Heading in Resources/ConsentDocument.md.

Expected behavior

Headings should be rendered according to Markdown Syntax.

Additional context

Markdown is rendered currently using AttributedString. It appears that headings may not be supported natively.

Code of Conduct

philippzagar commented 3 months ago

Thanks @vishnuravi for creating the issue!

Sadly, as you already guessed, SwiftUI doesn't support the full Markdown-Syntax, such as headings, images, and so on (which makes sense from a Text rendering perspective). Therefore, we would need to use something like https://github.com/gonzalezreal/swift-markdown-ui, leading to its own downsides with the PDF Export of the signed Consent form and complexity.

I don't see a good (and easy) way out of this. For now, I guess we could just live with that (intended) behavior, even though it definitely is not optimal. However, we should properly document that in the Markdown View of SpeziViews.

vishnuravi commented 1 month ago

Closing this issue, agree with @philippzagar's response above.