// 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}))