1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Generator: Resolves #4229: Add support for compiling content script

This commit is contained in:
Laurent Cozic
2021-01-03 13:21:48 +00:00
parent 8492a7ee26
commit 3e948146cd
76 changed files with 2893 additions and 259 deletions

View File

@ -0,0 +1,28 @@
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' }
];
},
}
},
}