Fix some grammar problems in mediawiki

This commit is contained in:
Ian Gulliver
2014-06-30 20:28:23 -07:00
parent 58ab9a57db
commit a3b4eafd73
2 changed files with 25 additions and 9 deletions

22
test.js
View File

@@ -48,8 +48,8 @@ QUnit.test('Base', function(assert) {
'<u>this from being underlined</u>, or just try \n',
'&lt;pre&gt;interrupting cow style.&lt;/pre&gt;<comment>This is a ',
"comment and \nshouldn't be visible</comment><blockquote>This is a ",
"blockquote</blockquote></p><p><h2>Header 2</h2><h3>Header 3 ''with ",
"italics''</h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><hr>",
'blockquote</blockquote></p><p><h2>Header 2</h2><h3>Header 3 <i>with ',
'italics</i></h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><hr>',
'<ulli1>Item 1a</ulli1><ulli1>Item 1b</ulli1><ulli2>Item 2</ulli2><ulli3>',
'Item 3</ulli3><ulli1>Item 1c</ulli1><olli1>Item 1a</olli1><olli1>Item 1b',
'</olli1><olli2>Item 2</olli2><olli3>Item 3</olli3><olli1>Item 1c</olli1>',
@@ -63,5 +63,21 @@ QUnit.test('Base', function(assert) {
var context = new rr.Context(mediawiki, content);
var iterable = context.rules['wikidoc'].match(context);
assert.equal(iterable.next().value.nodes[0].innerHTML, expected);
console.log(expected);
});
QUnit.test('singleline-wikichunk', function(assert) {
assert.expect(1);
var content = [
"Regular line ''with italics''",
"=== Header 3 ''with italics'' ==="
].join('\n');
var expected = [
'<p>Regular line <i>with italics</i>',
'<h3>Header 3 <i>with italics</i></h3></p>'
].join('');
var context = new rr.Context(mediawiki, content);
var iterable = context.rules['wikidoc'].match(context);
assert.equal(iterable.next().value.nodes[0].innerHTML, expected);
});