Start of parsing of mediawiki text.
This commit is contained in:
15
test.js
15
test.js
@@ -1,10 +1,11 @@
|
||||
test('Simple', function() {
|
||||
expect(0);
|
||||
var grammar = {
|
||||
'rule1': [rr.Literal('=== '), rr.SingleLineText(), rr.Literal(' ===')],
|
||||
'rule2': [rr.SingleLineText(), rr.Literal('=')],
|
||||
};
|
||||
var parser = new RecentRunes(grammar);
|
||||
console.log(parser.parse('rule1', '=== bar ==='));
|
||||
console.log(parser.parse('rule2', 'foo=\nbar='));
|
||||
var parser = new RecentRunes(mediawiki);
|
||||
var result = parser.parse('wikidoc',
|
||||
'=== Heading ===\n\
|
||||
This is a wiki doc.\n\
|
||||
How about some <b>bold and <i>bold italic</i></b>.\n\
|
||||
I would also love some <nowiki>nowiki <b>foo</b></nowiki>');
|
||||
console.log(result);
|
||||
document.body.appendChild(result[1]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user