init(wrappedValue : String, options: [CMarkOption ]?, extensions: [GFMExtension]?) Applies the Markdown conversion and saves the original value.
@propertyWrapper
struct MarkdownBasic usage.
struct Content {
@Markdown var body: String
}
let content = Content(body: "# Hello")
// Automatic HTML conversion.
print(content.body) // "<h1>Hello</h1>"
Advanced usage.
struct Content {
@Markdown(
options: [.validateUTF8, .unsafe],
extensions: [.strikethrough, .tasklist]
) var body: String
}
let content = Content(body: "# Hello")
// Automatic HTML conversion.
print(content.body) // "<h1>Hello</h1>"
// Retrieve the original Markdown.
print(content.$body) // "# Hello"
init(wrappedValue : String, options: [CMarkOption ]?, extensions: [GFMExtension]?) var extensions: [GFMExtension]? var options: [CMarkOption ]? var projectedValue : String $.var wrappedValue : String func toHTML (options: [CMarkOption ], extensions: [GFMExtension]) -> String