Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('CommonMark', function(t) {
commonmark.forEach(function(test, n) {
var name = test.section + ' ' + test.relative
var file = vfile(name + '.md')
var result
var message
var exception
file.contents = test.markdown
result = processSync(file, commonmarkOptions)
n += 1
try {
assert.strictEqual(result, test.html)
} catch (error) {
exception = error
}
/*
* Gather fixtures.
*/
fixtures = fixtures.filter(isHidden);
integrations = integrations.filter(isHidden);
/*
* CommonMark.
*/
var section;
var start;
commonmark.forEach(function (test, position) {
if (section !== test.section) {
section = test.section;
start = position;
}
test.relative = position - start + 1;
});
/**
* Transform VDOM to HTML.
*
* @param {Array.} nodes - List of nodes.
* @return {string} - Stringified HTML.
*/
function wrap(nodes) {
var result = vdom2html(h('div', nodes));