変数に格納したマークダウンを表示する


変数に格納したマークダウンを表示する方法です。

変数に格納したマークダウンを表示する

ContentView.swift

import SwiftUI

struct ContentView: View {
    let markdownText: String = "**Snorlax** is the **most** cute pokemon!\n[About Snorlax](https://en.wikipedia.org/wiki/Snorlax)"

    var body: some View {
        Text(LocalizedStringKey(markdownText))
    }
}

#Preview {
    ContentView()
}