QUnit.module('mediawiki');
QUnit.test('Base', function(assert) {
assert.expect(1);
var content = [
"This is a paragraph with many text styles. This is ''italic'' and this ",
"is '''bold'''; this is '''''both'''''. This is underline as is ",
"this. This is '''''underlined, bold and italic'''''. ",
'This is strikethrough, as is this. Source ',
'code looks like this. Fixed width text looks like ',
'this.
This sentence is inline pre-formatted, which stops ',
"'''''this from being bold and italic.''''' This is a blockquote", '', '== Header 2 ==', "=== Header 3 ''with italics'' ===", '==== Header 4 ====', '===== Header 5 =====', '====== Header 6 ======', '----', '* Item 1a', '* Item 1b', '** Item 2', '*** Item 3', '* Item 1c', '# Item 1a', '# Item 1b', '## Item 2', '### Item 3', '# Item 1c', ";I don't really understand what a definition is", ': But blockquotes are easy', ':: Even larger ones', '::::: And really huge ones', ' This line is pre-formatted and
This is a paragraph with many text styles. This is italic and ',
'this \nis bold; this is both. This is underline',
' as is \nthis. This is underlined, bold and italic',
'. \nThis is strikethrough, as is this. ',
'Source \ncode looks like this. Fixed width text looks like ',
'\nthis.
This sentence is inline pre-formatted, which stops',
" \n'''''this from being bold and italic.''''' We can also \nstop ",
'<u>this from being underlined</u>, or just try \n',
'<pre>interrupting cow style.</pre>This is a ', 'blockquote
", 'But blockquotes are easy
This ',
'line is pre-formatted and <del>not interpolated</del>',
''
].join('');
var context = new rr.Context(mediawiki, content);
var iterable = context.rules['wikidoc'].match(context);
var rootNode = iterable.next().value.nodes[0];
rr.ApplyFilters(rootNode, mediawiki_filters);
assert.equal(rootNode.innerHTML, expected);
});
QUnit.test('singleline-wikichunk', function(assert) {
assert.expect(1);
var content = [
"Regular line ''with italics''",
"=== Header 3 ''with italics'' ==="
].join('\n');
var expected = [
'Regular line with italics', '