trivial nonsense
This commit is contained in:
parent
922a556ef0
commit
d626616de4
@ -368,60 +368,95 @@ var next = function() {
|
||||
|
||||
var tok = function() {
|
||||
switch (token.type) {
|
||||
case 'space':
|
||||
case 'space': {
|
||||
return '';
|
||||
case 'hr':
|
||||
}
|
||||
|
||||
case 'hr': {
|
||||
return '<hr>';
|
||||
case 'heading':
|
||||
return '<h' + token.depth + '>'
|
||||
}
|
||||
|
||||
case 'heading': {
|
||||
return '<h'
|
||||
+ token.depth
|
||||
+ '>'
|
||||
+ inline.lexer(token.text)
|
||||
+ '</h' + token.depth + '>';
|
||||
case 'block':
|
||||
+ '</h'
|
||||
+ token.depth
|
||||
+ '>';
|
||||
}
|
||||
|
||||
case 'block': {
|
||||
return '<pre><code>'
|
||||
+ escape(token.text)
|
||||
+ '</code></pre>';
|
||||
case 'blockquote_start':
|
||||
}
|
||||
|
||||
case 'blockquote_start': {
|
||||
var body = [];
|
||||
|
||||
while (next().type !== 'blockquote_end') {
|
||||
body.push(tok());
|
||||
}
|
||||
|
||||
return '<blockquote>'
|
||||
+ body.join('')
|
||||
+ '</blockquote>';
|
||||
case 'list_start':
|
||||
}
|
||||
|
||||
case 'list_start': {
|
||||
var type = token.ordered ? 'ol' : 'ul'
|
||||
, body = [];
|
||||
|
||||
while (next().type !== 'list_end') {
|
||||
body.push(tok());
|
||||
}
|
||||
return '<' + type + '>'
|
||||
|
||||
return '<'
|
||||
+ type
|
||||
+ '>'
|
||||
+ body.join('')
|
||||
+ '</' + type + '>';
|
||||
case 'list_item_start':
|
||||
+ '</'
|
||||
+ type
|
||||
+ '>';
|
||||
}
|
||||
|
||||
case 'list_item_start': {
|
||||
var body = [];
|
||||
|
||||
while (next().type !== 'list_item_end') {
|
||||
body.push(token.type === 'text'
|
||||
? text()
|
||||
: tok());
|
||||
}
|
||||
|
||||
return '<li>'
|
||||
+ body.join(' ')
|
||||
+ '</li>';
|
||||
case 'loose_item_start':
|
||||
}
|
||||
|
||||
case 'loose_item_start': {
|
||||
var body = [];
|
||||
|
||||
while (next().type !== 'list_item_end') {
|
||||
body.push(tok());
|
||||
}
|
||||
|
||||
return '<li>'
|
||||
+ body.join(' ')
|
||||
+ '</li>';
|
||||
case 'html':
|
||||
}
|
||||
|
||||
case 'html': {
|
||||
return inline.lexer(token.text);
|
||||
case 'text':
|
||||
}
|
||||
|
||||
case 'text': {
|
||||
return '<p>'
|
||||
+ text()
|
||||
+ '</p>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var text = function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user