'SwiftUI Text Markdown support for string variables or string interpolation not working [duplicate]
Solution 1:[1]
After test and fail moments, I found that Text only handles markdown when string literal is passed to initializer. as below:
to achieve the needed behavior:
let text: String = "**Hello** *World*"
Text("**Hello** *World*") // will be rendered with markdown formatting
Text(text) // will NOT be rendered according to markdown
Text(.init(text)) // will be rendered with markdown formatting
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ali Hamad |


