mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-02 04:08:10 +08:00
update markdown config
This commit is contained in:
parent
810c282799
commit
4206484edc
@ -53,24 +53,22 @@ cooking.add('vueMarkdown', {
|
||||
anchorLinkSymbol: '',
|
||||
anchorClassName: 'anchor'
|
||||
}],
|
||||
[require('markdown-it-container'), 'code', {
|
||||
[require('markdown-it-container'), 'demo', {
|
||||
validate: function(params) {
|
||||
return params.trim().match(/^code\s+(.*)$/);
|
||||
return params.trim().match(/^demo\s+(.*)$/);
|
||||
},
|
||||
|
||||
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) {
|
||||
// opening tag
|
||||
return '<div class="details">' +
|
||||
`<div class="summary">${md.utils.escapeHtml(m[1])}</div>` +
|
||||
'<div class="code">';
|
||||
|
||||
} else {
|
||||
// closing tag
|
||||
return '</div></div>\n';
|
||||
var html = tokens[idx + 1].content;
|
||||
return `<section class="demo">
|
||||
<div class="source">${html}</div>
|
||||
<div class="meta">
|
||||
<div class="description">${md.utils.escapeHtml(m[1])}</div>
|
||||
<div class="highlight">`;
|
||||
}
|
||||
return '</section>\n';
|
||||
}
|
||||
}]
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user