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