mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
29 lines
694 B
JavaScript
29 lines
694 B
JavaScript
function plugin(markdownIt, _options) {
|
|
const defaultRender = markdownIt.renderer.rules.fence || function(tokens, idx, options, env, self) {
|
|
return self.renderToken(tokens, idx, options, env, self);
|
|
};
|
|
|
|
markdownIt.renderer.rules.fence = function(tokens, idx, options, env, self) {
|
|
const token = tokens[idx];
|
|
if (token.info !== 'justtesting') return defaultRender(tokens, idx, options, env, self);
|
|
return `
|
|
<div class="just-testing">
|
|
<p>JUST TESTING: ${token.content}</p>
|
|
</div>
|
|
`;
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
default: function(_context) {
|
|
return {
|
|
plugin: plugin,
|
|
assets: function() {
|
|
return [
|
|
{ name: 'markdownItTestPlugin.css' }
|
|
];
|
|
},
|
|
}
|
|
},
|
|
}
|