|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "markdown" for Markdown
|
|
|
|
System.print(Markdown.toHtml("__bold underscore__")) // expect: <p><strong>bold underscore</strong></p>
|
|
|
|
var mixed = Markdown.toHtml("This is **bold** and *italic* text")
|
|
System.print(mixed.contains("<strong>bold</strong>")) // expect: true
|
|
System.print(mixed.contains("<em>italic</em>")) // expect: true
|
|
|
|
var code = Markdown.toHtml("Use `print()` function")
|
|
System.print(code.contains("<code>print()</code>")) // expect: true
|
|
|
|
var multi = Markdown.toHtml("**bold** and `code` and *italic*")
|
|
System.print(multi.contains("<strong>bold</strong>")) // expect: true
|
|
System.print(multi.contains("<code>code</code>")) // expect: true
|
|
System.print(multi.contains("<em>italic</em>")) // expect: true
|
|
|
|
var unclosed = Markdown.toHtml("This has *unclosed italic")
|
|
System.print(unclosed.contains("<p>")) // expect: true
|
|
|
|
var empty = Markdown.toHtml("**bold****more**")
|
|
System.print(empty.contains("<strong>bold</strong>")) // expect: true
|
|
System.print(empty.contains("<strong>more</strong>")) // expect: true
|