token.loose

This commit is contained in:
Christopher Jeffrey 2011-08-20 10:41:30 -05:00
parent 3a28fc2222
commit 716e08f9c5

View File

@ -145,9 +145,11 @@ block.token = function(str, tokens) {
item = item.replace(space, ''); item = item.replace(space, '');
} }
tokens.push({ tokens.push({
type: loose type: 'list_item_start',
? 'loose_item_start' loose: loose
: 'list_item_start' //loose
//? 'loose_item_start'
//: 'list_item_start'
}); });
block.token(item, tokens); block.token(item, tokens);
tokens.push({ tokens.push({
@ -396,21 +398,21 @@ var tok = function() {
case 'list_item_start': case 'list_item_start':
var body = []; var body = [];
while (next().type !== 'list_item_end') { while (next().type !== 'list_item_end') {
body.push(token.type === 'text' body.push(token.type === 'text' && !token.loose
? inline.lexer(token.text) ? inline.lexer(token.text)
: tok()); : tok());
} }
return '<li>' return '<li>'
+ body.join(' ') + body.join(' ')
+ '</li>'; + '</li>';
case 'loose_item_start': /*case 'loose_item_start':
var body = []; var body = [];
while (next().type !== 'list_item_end') { while (next().type !== 'list_item_end') {
body.push(tok()); body.push(tok());
} }
return '<li>' return '<li>'
+ body.join(' ') + body.join(' ')
+ '</li>'; + '</li>';*/
case 'html': case 'html':
return inline.lexer(token.text); return inline.lexer(token.text);
case 'text': case 'text':