2015-06-17 08:22:05 +08:00
|
|
|
/**
|
|
|
|
* Created by Estevao on 08-06-2015.
|
|
|
|
*/
|
2015-07-12 02:32:22 +08:00
|
|
|
var bootstrap = require('../bootstrap.js'),
|
|
|
|
showdown = bootstrap.showdown,
|
2015-06-17 08:22:05 +08:00
|
|
|
assertion = bootstrap.assertion,
|
2015-07-11 23:44:24 +08:00
|
|
|
testsuite = bootstrap.getTestSuite('test/features/'),
|
|
|
|
tableSuite = bootstrap.getTestSuite('test/features/tables/');
|
2015-06-17 08:22:05 +08:00
|
|
|
|
|
|
|
describe('makeHtml() features testsuite', function () {
|
|
|
|
'use strict';
|
|
|
|
for (var i = 0; i < testsuite.length; ++i) {
|
|
|
|
var converter;
|
|
|
|
if (testsuite[i].name === '#143.support_image_dimensions') {
|
|
|
|
converter = new showdown.Converter({parseImgDimensions: true});
|
2015-06-17 09:19:44 +08:00
|
|
|
} else if (testsuite[i].name === '#69.header_level_start') {
|
|
|
|
converter = new showdown.Converter({headerLevelStart: 3});
|
2015-07-11 09:42:53 +08:00
|
|
|
} else if (testsuite[i].name === '#164.1.simple_autolink') {
|
|
|
|
converter = new showdown.Converter({simplifiedAutoLink: true});
|
2015-07-11 22:45:58 +08:00
|
|
|
} else if (testsuite[i].name === '#164.2.disallow_underscore_emphasis_mid_word') {
|
|
|
|
converter = new showdown.Converter({literalMidWordUnderscores: true});
|
2015-07-11 22:59:06 +08:00
|
|
|
} else if (testsuite[i].name === '#164.3.strikethrough') {
|
|
|
|
converter = new showdown.Converter({strikethrough: true});
|
2015-07-12 06:02:02 +08:00
|
|
|
} else if (testsuite[i].name === 'disable_gh_codeblocks') {
|
2015-07-12 03:33:11 +08:00
|
|
|
converter = new showdown.Converter({ghCodeBlocks: false});
|
2015-07-12 06:02:02 +08:00
|
|
|
} else if (testsuite[i].name === '#164.4.tasklists') {
|
|
|
|
converter = new showdown.Converter({tasklists: true});
|
2015-07-15 03:53:28 +08:00
|
|
|
} else if (testsuite[i].name === 'autolink_and_disallow_underscores') {
|
|
|
|
converter = new showdown.Converter({literalMidWordUnderscores: true, simplifiedAutoLink: true});
|
2015-06-17 08:22:05 +08:00
|
|
|
} else {
|
|
|
|
converter = new showdown.Converter();
|
|
|
|
}
|
|
|
|
it(testsuite[i].name, assertion(testsuite[i], converter));
|
|
|
|
}
|
2015-07-11 23:44:24 +08:00
|
|
|
|
|
|
|
describe('table support', function () {
|
2015-07-12 01:21:43 +08:00
|
|
|
var converter;
|
2015-07-11 23:44:24 +08:00
|
|
|
for (var i = 0; i < tableSuite.length; ++i) {
|
2015-07-12 01:21:43 +08:00
|
|
|
if (tableSuite[i].name === 'basic_with_header_ids') {
|
|
|
|
converter = new showdown.Converter({tables: true, tableHeaderId: true});
|
2015-07-22 19:03:38 +08:00
|
|
|
} else if (tableSuite[i].name === '#179.parse_md_in_table_ths') {
|
|
|
|
converter = new showdown.Converter({tables: true, strikethrough: true});
|
2015-07-12 01:21:43 +08:00
|
|
|
} else {
|
|
|
|
converter = new showdown.Converter({tables: true});
|
|
|
|
}
|
2015-07-11 23:44:24 +08:00
|
|
|
it(tableSuite[i].name, assertion(tableSuite[i], converter));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-06-17 08:22:05 +08:00
|
|
|
});
|