markdown
Version:
A sensible Markdown parser for javascript
49 lines (48 loc) • 1.12 kB
JSON
["html", ["p", ["img", {
"src": "/path/to/img.jpg",
"alt": "Alt text"
}]],
["p", ["img", {
"src": "/path/to/img.jpg",
"alt": "Alt text",
"title": "Optional title"
}]],
["p", "Inline within a paragraph: ", ["a", {
"href": "/url/"
},
"alt text"], "."],
["p", ["img", {
"src": "/url/",
"alt": "alt text",
"title": "title preceded by two spaces"
}]],
["p", ["img", {
"src": "/url/",
"alt": "alt text",
"title": "title has spaces afterward"
}]],
["p", ["img", {
"src": "/url/",
"alt": "alt text"
}]],
["p", ["img", {
"src": "/url/",
"alt": "alt text",
"title": "with a title"
}], "."],
["p", ["img", {
"alt": "Empty"
}]],
["p", ["img", {
"src": "http://example.com/(parens).jpg",
"alt": "this is a stupid URL"
}]],
["p", ["img", {
"src": "/url/",
"alt": "alt text"
}]],
["p", ["img", {
"src": "/url/",
"alt": "alt text",
"title": "Title here"
}]]]