line parsing

This commit is contained in:
Christopher Jeffrey 2011-08-16 08:33:06 -05:00
parent 71f36e8b50
commit 29e887184d

View File

@ -408,15 +408,14 @@ var tok = function() {
case 'html': case 'html':
return inline.lexer(token.text); return inline.lexer(token.text);
case 'text': case 'text':
var body = [] var body = [ token.text ]
, last = token.line; , last = token.line
while (token && token.type === 'text') { , top;
if (token.line > last) break; while ((top = tokens[tokens.length-1])
last = token.line + 1; && top.type === 'text'
body.push(token.text); && top.line === ++last) {
next(); body.push(next().text);
} }
if (token) tokens.push(token);
return '<p>' return '<p>'
+ inline.lexer(body.join(' ')) + inline.lexer(body.join(' '))
+ '</p>'; + '</p>';