mirror of
https://github.com/amehime/hexo-renderer-multi-markdown-it.git
synced 2026-04-05 13:09:04 +08:00
update
This commit is contained in:
@@ -79,14 +79,16 @@ module.exports = function (data, options) {
|
||||
}
|
||||
|
||||
if (plugins.name == 'markdown-it-container') {
|
||||
return parser.use(plugin, 'segment', {
|
||||
|
||||
return parser.use(plugin, 'note', {
|
||||
validate: function (params) {
|
||||
return params.trim().match(/^note\s+(default|primary|success|info|warning|danger)$/);
|
||||
},
|
||||
render: function (tokens, idx) {
|
||||
var m = tokens[idx].info.trim().match(/^segment\s+(.*)$/);
|
||||
var m = tokens[idx].info.trim().match(/^note\s+(.*)$/);
|
||||
|
||||
if (tokens[idx].nesting === 1) {
|
||||
// opening tag
|
||||
return '<div class="' + m[1] + '">\n';
|
||||
return '<div class="note ' + m[1] + '">\n';
|
||||
|
||||
} else {
|
||||
// closing tag
|
||||
|
||||
Reference in New Issue
Block a user