Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions exercises/markdown/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
{
"#": [
"exercise": "markdown",
"version": "1.0.0",
"comments": [
"Markdown is a shorthand for creating HTML from text strings."
],
"methods": {
"description": [
"Check the public API is correct."
],
"cases": [{
"description": "must be able to parse a Markdown string",
"method": "parse",
"arity": 1
}]
},
"cases": [
{
"description": "parses normal text as a paragraph",
"input": "This will be a paragraph",
"expected": "<p>This will be a paragraph</p>"
"description": "parses normal text as a paragraph",
"property": "parse",
"input": "This will be a paragraph",
"expected": "<p>This will be a paragraph</p>"
},
{
"description": "parsing italics",
"property": "parse",
"input": "_This will be italic_",
"expected": "<p><em>This will be italic</em></p>"
},
{
"description": "parsing bold text",
"property": "parse",
"input": "__This will be bold__",
"expected": "<p><strong>This will be bold</strong></p>"
},
{
"description": "mixed normal, italics and bold text",
"property": "parse",
"input": "This will _be_ __mixed__",
"expected": "<p>This will <em>be</em> <strong>mixed</strong></p>"
},
{
"description": "with h1 header level",
"property": "parse",
"input": "# This will be an h1",
"expected": "<h1>This will be an h1</h1>"
},
{
"description": "with h2 header level",
"property": "parse",
"input": "## This will be an h2",
"expected": "<h2>This will be an h2</h2>"
},
{
"description": "with h6 header level",
"property": "parse",
"input": "###### This will be an h6",
"expected": "<h6>This will be an h6</h6>"
},
{
"description": "unordered lists",
"property": "parse",
"input": "* Item 1\n* Item 2",
"expected": "<ul><li><p>Item 1</p></li><li><p>Item 2</p></li></ul>"
},
{
"description": "With a little bit of everything",
"property": "parse",
"input": "# Header!\n* __Bold Item__\n* _Italic Item_",
"expected": "<h1>Header!</h1><ul><li><strong>Bold Item</strong></li><li><em>Italic Item</em></li></ul>"
}
Expand Down