Renders markdown-formatted text with full styling support.
Preview
Renders headers, bold, italic, links, code blocks, lists, and more.
Usage
go
1node := models.WidgetNode{2 Type: models.WidgetNodeTypeMarkdown,3 Value: "## Summary\n\nThis is **bold** and this is *italic*.",4}Props
| Name | Type | Description | Default |
|---|---|---|---|
type | "markdown" | Node type | required |
value | string | Markdown content | "" |
Examples
Basic Markdown
go
1{2 Type: models.WidgetNodeTypeMarkdown,3 Value: "Hello **world**!",4}Rich Content
go
1{2 Type: models.WidgetNodeTypeMarkdown,3 Value: `## Analysis Results4 5Here are the key findings:6 7- **Performance**: 15% improvement8- **Coverage**: 98% test coverage9- **Issues**: 3 minor warnings10 11\`\`\`json12{13 "status": "success",14 "score": 9515}16\`\`\`17`,18}Code Snippet
go
1{2 Type: models.WidgetNodeTypeMarkdown,3 Value: "Install with:\n\n```bash\nnpm install @inference/sdk\n```",4}Links and Lists
go
1{2 Type: models.WidgetNodeTypeMarkdown,3 Value: `Check out these resources:4 51. [Documentation](https://docs.example.com)62. [API Reference](https://api.example.com)73. [Examples](https://github.com/example)8`,9}Supported Syntax
| Element | Syntax |
|---|---|
| Headers | # H1, ## H2, ### H3 |
| Bold | **bold** |
| Italic | *italic* |
| Code | `code` |
| Code blocks | ```lang ``` |
| Links | [text](url) |
| Lists | - item or 1. item |
| Blockquotes | > quote |
TypeScript
typescript
1const node: WidgetNode = {2 type: "markdown",3 value: "## Hello\n\nThis is **markdown**.",4}Best Practices
- Use for rich content - Long-form text, documentation, explanations
- Use Text for simple content - Single-line text without formatting
- Escape special characters - Use backslash for literal
*,#, etc. - Test rendering - Preview markdown before shipping