Index: trunk/extensions/ParserPlayground/tests/parserTests.js |
— | — | @@ -128,6 +128,10 @@ |
129 | 129 | if (err) { |
130 | 130 | console.log('RENDER FAIL', err); |
131 | 131 | } else { |
| 132 | + console.log('EXPECTED:'); |
| 133 | + console.log(item.result + "\n"); |
| 134 | + |
| 135 | + console.log('RENDERED:'); |
132 | 136 | console.log(node.innerHTML + "\n"); |
133 | 137 | } |
134 | 138 | }); |
Index: trunk/extensions/ParserPlayground/modules/ext.parserPlayground.renderer.js |
— | — | @@ -129,10 +129,10 @@ |
130 | 130 | $.map(tree.attrs, function(val, key) { |
131 | 131 | $span.attr(key, val); // @fixme safety! |
132 | 132 | }); |
133 | | - if ('content' in tree) { |
134 | | - subParseArray(tree.content, $span); |
135 | | - } |
136 | 133 | } |
| 134 | + if ('content' in tree) { |
| 135 | + subParseArray(tree.content, $span); |
| 136 | + } |
137 | 137 | node = $span[0]; |
138 | 138 | break; |
139 | 139 | case 'hashlink': |
Index: trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | block |
17 | 17 | = br |
18 | 18 | / h |
| 19 | + / li |
19 | 20 | / para |
20 | 21 | |
21 | 22 | h = h1 / h2 / h3 / h4 / h5 / h6 |
— | — | @@ -345,3 +346,21 @@ |
346 | 347 | = t:[0-9A-Za-z]+ { return {text: t.join('') } } |
347 | 348 | / "'" t:[^'>]+ "'" { return { quote: "'", text: t.join('') } } |
348 | 349 | / '"' t:[^">]+ '"' { return { quote: '"', text: t.join('') } } |
| 350 | + |
| 351 | + |
| 352 | +li = bullets:list_char+ |
| 353 | + c:(inline / anything) |
| 354 | + newline |
| 355 | +{ |
| 356 | + return { |
| 357 | + type: 'li', |
| 358 | + listStyle: bullets, |
| 359 | + content: c |
| 360 | + }; |
| 361 | +} |
| 362 | + |
| 363 | +list_char = |
| 364 | + '*' / |
| 365 | + '#' / |
| 366 | + ':' / |
| 367 | + ';' |