Files
wren/example/markdown_demo.wren
T
retoor 5a4054ec66 feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules
Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
2026-01-24 22:40:22 +00:00

53 lines
915 B
JavaScript
Vendored

// retoor <retoor@molodetz.nl>
import "markdown" for Markdown
System.print("=== Markdown Module Demo ===")
var markdown = "# Welcome to Markdown
This is a **bold** statement and this is *italic*.
## Features
- Easy to read
- Easy to write
- Converts to HTML
### Code Example
Here is some `inline code`.
```
function hello() {
console.log(\"Hello, World!\")
}
```
### Links and Images
Check out [Wren](https://wren.io) for more info.
![Logo](logo.png)
> This is a blockquote.
> It can span multiple lines.
---
1. First item
2. Second item
3. Third item
That's all folks!"
System.print("\n--- Source Markdown ---")
System.print(markdown)
System.print("\n--- Generated HTML ---")
System.print(Markdown.toHtml(markdown))
System.print("\n--- Safe Mode Example ---")
var unsafe = "# Title\n\n<script>alert('xss')</script>\n\nSafe content."
System.print(Markdown.toHtml(unsafe, {"safeMode": true}))