---
title: MarkdownDecodableAttributedStringKey
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/markdowndecodableattributedstringkey
---

# MarkdownDecodableAttributedStringKey

A protocol that defines how an attribute key decodes a value that corresponds to Markdown syntax.

## Declaration

```swift
protocol MarkdownDecodableAttributedStringKey : AttributedStringKey
```

## Overview

Overview This protocol is separate from DecodableAttributedStringKey to separate explicit attributes defined by the SDK from Markdown’s semantic styling attributes. You use these attributes with Apple’s extended syntax for markdown: ^[text](attribute: value). Using this protocol allows your markup names to differ from the names of your attributes. For example, the automatic grammar agreement feature uses markup like ^[text to inflect](inflect: true). This feature defines an AttributeScopes.FoundationAttributes.InflectionRuleAttribute that conforms to MarkdownDecodableAttributedStringKey. The value of its AttributeScopes/FoundationAttributes/InflectionRuleAttribute/name proprerty is NSInflect, while its AttributeScopes/FoundationAttributes/InflectionRuleAttribute/markdownName-aom1, used in actual Markdown strings like the one shown here, is inflect. To define your own attributes for use with Markdown syntax, make sure your attributes conform to this protocol. The markdown parser ignores attributes that don’t conform, even if you use the extended Markdown syntax. tip: When creating attributed strings from Markdown-based initializers like init(markdown:options:baseURL:), be sure to set the allowsExtendedAttributes option. If you don’t include this option, the string won’t parse MarkdownDecodableAttributedStringKey-based attributes.

## Topics

### Decoding Values

- [decodeMarkdown(from:)](foundation/markdowndecodableattributedstringkey/decodemarkdown(from:).md)

### Accessing the Markdown Name

- [markdownName](foundation/markdowndecodableattributedstringkey/markdownname.md)

## Relationships

### Inherits From

- [AttributedStringKey](foundation/attributedstringkey.md)
- [SendableMetatype](swift/sendablemetatype.md)

### Conforming Types

- [AttributeScopes.AccessibilityAttributes.AdjustedPitchAttribute](foundation/attributescopes/accessibilityattributes/adjustedpitchattribute.md)
- [AttributeScopes.AccessibilityAttributes.AnnouncementPriorityAttribute](foundation/attributescopes/accessibilityattributes/announcementpriorityattribute.md)
- [AttributeScopes.AccessibilityAttributes.HeadingLevelAttribute](foundation/attributescopes/accessibilityattributes/headinglevelattribute.md)
- [AttributeScopes.AccessibilityAttributes.IPANotationAttribute](foundation/attributescopes/accessibilityattributes/ipanotationattribute.md)
- [AttributeScopes.AccessibilityAttributes.IncludesPunctuationAttribute](foundation/attributescopes/accessibilityattributes/includespunctuationattribute.md)
- [AttributeScopes.AccessibilityAttributes.QueueAnnouncementAttribute](foundation/attributescopes/accessibilityattributes/queueannouncementattribute.md)
- [AttributeScopes.AccessibilityAttributes.SpellOutAttribute](foundation/attributescopes/accessibilityattributes/spelloutattribute.md)
- [AttributeScopes.AccessibilityAttributes.TextCustomAttribute](foundation/attributescopes/accessibilityattributes/textcustomattribute.md)
- [AttributeScopes.AccessibilityAttributes.TextualContextAttribute](foundation/attributescopes/accessibilityattributes/textualcontextattribute.md)
- [AttributeScopes.FoundationAttributes.AgreementArgumentAttribute](foundation/attributescopes/foundationattributes/agreementargumentattribute.md)
- [AttributeScopes.FoundationAttributes.AgreementConceptAttribute](foundation/attributescopes/foundationattributes/agreementconceptattribute.md)
- [AttributeScopes.FoundationAttributes.InflectionAlternativeAttribute](foundation/attributescopes/foundationattributes/inflectionalternativeattribute.md)
- [AttributeScopes.FoundationAttributes.InflectionRuleAttribute](foundation/attributescopes/foundationattributes/inflectionruleattribute.md)
- [AttributeScopes.FoundationAttributes.LanguageIdentifierAttribute](foundation/attributescopes/foundationattributes/languageidentifierattribute.md)
- [AttributeScopes.FoundationAttributes.LocalizedNumberFormatAttribute](foundation/attributescopes/foundationattributes/localizednumberformatattribute.md)
- [AttributeScopes.FoundationAttributes.MorphologyAttribute](foundation/attributescopes/foundationattributes/morphologyattribute.md)
- [AttributeScopes.FoundationAttributes.ReferentConceptAttribute](foundation/attributescopes/foundationattributes/referentconceptattribute.md)
