mirror of
https://github.com/amehime/hexo-renderer-multi-markdown-it.git
synced 2026-04-05 21:39:36 +08:00
update
This commit is contained in:
@@ -19,4 +19,24 @@ module.exports = function (md, options) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
md.use(plugin, 'tab', {
|
||||
|
||||
validate: function(params) {
|
||||
return params.trim().match(/^tab\s+(.*)\|\|(.*)$/);
|
||||
},
|
||||
|
||||
render: function (tokens, idx) {
|
||||
var m = tokens[idx].info.trim().match(/^tab\s+(.*)\|\|(.*)$/);
|
||||
|
||||
if (tokens[idx].nesting === 1) {
|
||||
// opening tag
|
||||
return '<div class="tab" data-id="'+m[1].trim()+'" data-title="'+m[2].trim()+'">\n';
|
||||
|
||||
} else {
|
||||
// closing tag
|
||||
return '</div>\n';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-renderer-multi-markdown-it",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"description": "A Markdown parser for Hexo and auto Minify HTML, CSS, JS.",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/amehime/hexo-renderer-multi-markdown-it.git",
|
||||
|
||||
Reference in New Issue
Block a user