Add link support to mediawiki grammer. Fix a bug in rr.Node()
This commit is contained in:
16
test.js
16
test.js
@@ -81,3 +81,19 @@ QUnit.test('singleline-wikichunk', function(assert) {
|
||||
var iterable = context.rules['wikidoc'].match(context);
|
||||
assert.equal(iterable.next().value.nodes[0].innerHTML, expected);
|
||||
});
|
||||
|
||||
QUnit.test('Link', function(assert) {
|
||||
assert.expect(1);
|
||||
var content = [
|
||||
"[[http://www.example.com/foo|Test text ''with formatting'']]"
|
||||
].join('\n');
|
||||
|
||||
var expected = [
|
||||
'<p><a><href>http://www.example.com/foo</href>',
|
||||
'Test text <i>with formatting</i></a></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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user