mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Updated to support container syntax and styles
This commit is contained in:
parent
2a42fac6d4
commit
e729166c32
6 changed files with 28 additions and 0 deletions
|
@ -93,6 +93,17 @@ md.renderer.rules.code_block = function (tokens, idx, options, env, self) {
|
|||
}
|
||||
return '<pre><code>' + md.utils.escapeHtml(tokens[idx].content) + '</code></pre>\n';
|
||||
};
|
||||
function renderContainer(tokens, idx, options, env, self) {
|
||||
tokens[idx].attrJoin('role', 'alert');
|
||||
tokens[idx].attrJoin('class', 'alert');
|
||||
tokens[idx].attrJoin('class', 'alert-' + tokens[idx].info.trim());
|
||||
addPart(tokens, idx);
|
||||
return self.renderToken.apply(self, arguments);
|
||||
}
|
||||
md.use(window.markdownitContainer, 'success', { render: renderContainer });
|
||||
md.use(window.markdownitContainer, 'info', { render: renderContainer });
|
||||
md.use(window.markdownitContainer, 'warning', { render: renderContainer });
|
||||
md.use(window.markdownitContainer, 'danger', { render: renderContainer });
|
||||
|
||||
var preventSyncScroll = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue