Skip to content

Commit

Permalink
test: inline html tests
Browse files Browse the repository at this point in the history
These are based on test/original/inline_html_simple.md
  • Loading branch information
davisjam committed Mar 4, 2018
1 parent a693f23 commit b681158
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/integration/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ describe('integration suite', function () {
expect(marked('Hello World!')).toBe('<p>Hello World!</p>\n');
});

describe('inline html', function () {
it('should permit inline html', function () {
var inlineHtmlExamples = [{'md': '<div>foo</div>', 'html': '<div>foo</div>'},
{'md': '<div>outer <div>inner</div> </div>', 'html': '<div>outer <div>inner</div> </div>'},
{'md': '<!-- Comment -->', 'html': '<!-- Comment -->'},
{'md': '<!-- \nMultiline\nComment\n-->', 'html': '<!-- \nMultiline\nComment\n-->'},
{'md': '<hr>', 'html': '<hr>'},
{'md': '<hr/>', 'html': '<hr/>'},
{'md': '<hr/>', 'html': '<hr/>'},
{'md': '<hr />', 'html': '<hr />'},
{'md': '<hr class="foo" id="bar" />', 'html': '<hr class="foo" id="bar" />'},
{'md': '<hr class="foo" id="bar"/>', 'html': '<hr class="foo" id="bar"/>'},
{'md': '<hr class="foo" id="bar" >', 'html': '<hr class="foo" id="bar" >'},
];

inlineHtmlExamples.forEach(function(example) {
expect(marked(example.md)).toBe(example.html);
});

});
});

describe('links inline style', function () {

it('should handle regular links', function () {
Expand Down

0 comments on commit b681158

Please sign in to comment.