Commit 4206484e authored by qingwei.li's avatar qingwei.li

update markdown config

parent 810c2827
...@@ -53,24 +53,22 @@ cooking.add('vueMarkdown', { ...@@ -53,24 +53,22 @@ cooking.add('vueMarkdown', {
anchorLinkSymbol: '', anchorLinkSymbol: '',
anchorClassName: 'anchor' anchorClassName: 'anchor'
}], }],
[require('markdown-it-container'), 'code', { [require('markdown-it-container'), 'demo', {
validate: function(params) { validate: function(params) {
return params.trim().match(/^code\s+(.*)$/); return params.trim().match(/^demo\s+(.*)$/);
}, },
render: function (tokens, idx) { render: function (tokens, idx) {
var m = tokens[idx].info.trim().match(/^code\s+(.*)$/); var m = tokens[idx].info.trim().match(/^demo\s+(.*)$/);
if (tokens[idx].nesting === 1) { if (tokens[idx].nesting === 1) {
// opening tag var html = tokens[idx + 1].content;
return '<div class="details">' + return `<section class="demo">
`<div class="summary">${md.utils.escapeHtml(m[1])}</div>` + <div class="source">${html}</div>
'<div class="code">'; <div class="meta">
<div class="description">${md.utils.escapeHtml(m[1])}</div>
} else { <div class="highlight">`;
// closing tag
return '</div></div>\n';
} }
return '</section>\n';
} }
}] }]
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment