UNPKG

npm-creole

Version:

npm package for parsing wiki creole. fork of https://github.com/codeholic/jscreole/network

35 lines (29 loc) 985 B
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head xmlns="http://www.w3.org/1999/xhtml"> <title>tests/base.html</title> <script type="text/javascript" src="../lib/creole.js"></script> <script type="text/javascript" src="lib/JSAN.js"></script> </head> <body> <pre id="test"> <script type="text/javascript"><!--<![CDATA[ var jsan = new JSAN('lib'); jsan.use('Test.More'); plan({ tests: 1 }); // Define grammar var grammar = { p: { _regex: new RegExp('[ \\t]*\\S.*((\\r?\\n|\\n)[ \\t]*\\S.*)'), _capture: 0, _tag: 'p' } }; grammar._root = { _children: [ grammar.p ] }; // Prepare objects var div = document.createElement('div'); var p = new creole._base(grammar); // Begin tests p.parse(div, 'para\n continues\n\nanother para\n \nyet another para'); ok(true, 'dummy'); //]]>--></script> </pre> </body> </html>