// retoor <retoor@molodetz.nl>
import "markdown" for Markdown
var basic = "| A | B |\n|---|---|\n| 1 | 2 |"
var html = Markdown.toHtml(basic)
System.print(html.contains("<table>")) // expect: true
System.print(html.contains("<thead>")) // expect: true
System.print(html.contains("<tbody>")) // expect: true
System.print(html.contains("<th>A</th>")) // expect: true
System.print(html.contains("<td>1</td>")) // expect: true
var aligned = "| Left | Center | Right |\n|:---|:---:|---:|\n| L | C | R |"
var alignedHtml = Markdown.toHtml(aligned)
System.print(alignedHtml.contains("text-align:center")) // expect: true
System.print(alignedHtml.contains("text-align:right")) // expect: true
var multiRow = "| H1 | H2 |\n|---|---|\n| A | B |\n| C | D |"
var multiHtml = Markdown.toHtml(multiRow)
System.print(multiHtml.contains("<td>A</td>")) // expect: true
System.print(multiHtml.contains("<td>D</td>")) // expect: true
var inlineTable = "| **Bold** | *Italic* |\n|---|---|\n| `code` | [link](url) |"
var inlineHtml = Markdown.toHtml(inlineTable)
System.print(inlineHtml.contains("<strong>Bold</strong>")) // expect: true
System.print(inlineHtml.contains("<em>Italic</em>")) // expect: true
System.print(inlineHtml.contains("<code>code</code>")) // expect: true