|
@ -18,13 +18,23 @@ var escapeHtml = require('./common/utils').escapeHtml; |
|
|
var default_rules = {}; |
|
|
var default_rules = {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default_rules.code_inline = function (tokens, idx /*, options, env */) { |
|
|
default_rules.code_inline = function (tokens, idx, options, env, slf) { |
|
|
return '<code>' + escapeHtml(tokens[idx].content) + '</code>'; |
|
|
var token = tokens[idx], |
|
|
|
|
|
attrs = slf.renderAttrs(token); |
|
|
|
|
|
|
|
|
|
|
|
return '<code' + (attrs ? ' ' + attrs : '') + '>' + |
|
|
|
|
|
escapeHtml(tokens[idx].content) + |
|
|
|
|
|
'</code>'; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default_rules.code_block = function (tokens, idx /*, options, env */) { |
|
|
default_rules.code_block = function (tokens, idx, options, env, slf) { |
|
|
return '<pre><code>' + escapeHtml(tokens[idx].content) + '</code></pre>\n'; |
|
|
var token = tokens[idx], |
|
|
|
|
|
attrs = slf.renderAttrs(token); |
|
|
|
|
|
|
|
|
|
|
|
return '<pre' + (attrs ? ' ' + attrs : '') + '><code>' + |
|
|
|
|
|
escapeHtml(tokens[idx].content) + |
|
|
|
|
|
'</code></pre>\n'; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|