markdownarea Component
Use the markdownarea component to create a plain-text input box where text is formatted using Markdown syntax.
{
"type": "markdownarea",
"text": "Hello **World**!"
}
Markdown makes it easy to add formatting - such as bolding, italics and hyperlinks without complex editing.
TipIt's good practice to use the
sizeshared constraint to set a desired size for this layout. This acts like a minimum size in a layout.
Properties
- autoadjustcontentinsets
- BOOL
- Default:
true
Automatically adjusts the scroll view's internal content insets property to account for any overlapping title bar.
Useful if you are using external Alfred UIs with transparent title bar and full size content views.
- urischemes
- ARRAY
- Default:
"http", "https"
Override the default URI schemes which are recognised as links, for example mailto:.
This will only affect newly parsed markdown for this view, and not alter existing parsed markdown.
ImportantIf you set this value, you are overriding the defaults, so be sure to include
httpandhttpsif you'd like these to still be recognised.
- behaviour
- OBJECT
Tweak the behaviour when text is added.
- mode
- ENUM
- Default:
"replace"
How to add and re-parse the specified text or src.
| Value | Description |
|---|---|
"replace" |
Replace all the text. |
"append" |
Append the text to the end of the current text. |
"prepend" |
Prepend the text to the start of the current text. |
"replacelast" |
Replace the last set text with the new text. |
- scroll
- ENUM
- Default:
"none"
The scroll behaviour after setting text based on the mode.
| Value | Description |
|---|---|
"none" |
Don't scroll on setting text. |
"auto" |
Automatically scroll on setting text. |
"start" |
Scroll to the start of the document on setting text. |
"end" |
Scroll to the end of the document on setting text. |
Also see Shared Properties.
Example Workflows
Parsed markdown
This example also overrides the default desired size to 300x300px.
{
"constraints": {
"size": {
"width": 300,
"height": 300
}
},
"type": "markdownarea",
"text": "# Here Is a Title\n\nAnd here is a list with:\n\n- **bold** text.\n\n- *italic* text.\n\n- Inline `code`."
}