---
title: "init(markdown:options:baseURL:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsattributedstring/init(markdown:options:baseurl:)-5nru2"
---

# init(markdown:options:baseURL:)

Creates an attributed string from Markdown-formatted data using the provided options.

## Declaration

```swift
convenience init(markdown: Data, options: AttributedString.MarkdownParsingOptions = .init(), baseURL: URL? = nil) throws
```

## Parameters

- `markdown`: The doc://com.apple.foundation/documentation/Foundation/Data instance that contains the Markdown formatting.
- `options`: Options that affect how the initializer interprets formatting in the Markdown string. This parameter defaults to no options.
- `baseURL`: The base URL to use when resolving Markdown URLs. The initializer treats URLs as being relative to this URL. If this value is nil, the initializer doesn’t resolve URLs. The default is nil.

## See Also

### Creating from markdown

- [init(markdown:options:baseURL:)](foundation/nsattributedstring/init(markdown:options:baseurl:)-m9n.md)
- [init(contentsOf:options:baseURL:)](foundation/nsattributedstring/init(contentsof:options:baseurl:).md)
