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':
return inline.lexer(token.text);
case 'text':
var body = []
, last = token.line;
while (token && token.type === 'text') {
if (token.line > last) break;
last = token.line + 1;
body.push(token.text);
next();
var body = [ token.text ]
, last = token.line
, top;
while ((top = tokens[tokens.length-1])
&& top.type === 'text'
&& top.line === ++last) {
body.push(next().text);
}
if (token) tokens.push(token);
return '<p>'
+ inline.lexer(body.join(' '))
+ '</p>';