|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "markdown" for Markdown
|
|
|
|
var doc = "# Title
|
|
|
|
This is a paragraph with **bold** text.
|
|
|
|
- Item 1
|
|
- Item 2
|
|
|
|
Another paragraph.
|
|
|
|
> A quote
|
|
|
|
---
|
|
|
|
## Subtitle
|
|
|
|
1. First
|
|
2. Second"
|
|
|
|
var html = Markdown.toHtml(doc)
|
|
System.print(html.contains("<h1>Title</h1>")) // expect: true
|
|
System.print(html.contains("<strong>bold</strong>")) // expect: true
|
|
System.print(html.contains("<ul>")) // expect: true
|
|
System.print(html.contains("<li>Item 1</li>")) // expect: true
|
|
System.print(html.contains("<blockquote>")) // expect: true
|
|
System.print(html.contains("<hr>")) // expect: true
|
|
System.print(html.contains("<h2>Subtitle</h2>")) // expect: true
|
|
System.print(html.contains("<ol>")) // expect: true
|
|
System.print(html.contains("<li>First</li>")) // expect: true
|
|
|
|
var linkInList = Markdown.toHtml("- [Link](http://example.com)")
|
|
System.print(linkInList.contains("<li>")) // expect: true
|
|
System.print(linkInList.contains("<a href=\"http://example.com\">Link</a>")) // expect: true
|
|
|
|
var codeInHeading = Markdown.toHtml("# Using `print()`")
|
|
System.print(codeInHeading.contains("<h1>")) // expect: true
|
|
System.print(codeInHeading.contains("<code>print()</code>")) // expect: true
|