diff --git a/packages/app-cli/tests/support/plugins/content_script/src/index.ts b/packages/app-cli/tests/support/plugins/content_script/src/index.ts index c7ed3d092..1fb7038fb 100644 --- a/packages/app-cli/tests/support/plugins/content_script/src/index.ts +++ b/packages/app-cli/tests/support/plugins/content_script/src/index.ts @@ -3,6 +3,22 @@ import { ContentScriptType } from 'api/types'; joplin.plugins.register({ onStart: async function() { + await joplin.commands.register({ + name: 'testCommand', + label: 'My Test Command', + execute: async (...args) => { + alert('Got command "testCommand" with args: ' + JSON.stringify(args)); + }, + }); + + await joplin.commands.register({ + name: 'testCommandNoArgs', + label: 'My Test Command (no args)', + execute: async () => { + alert('Got command "testCommandNoArgs"'); + }, + }); + await joplin.plugins.registerContentScript( ContentScriptType.MarkdownItPlugin, 'justtesting', diff --git a/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.css b/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.css index a168fce07..dcfc4e668 100644 --- a/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.css +++ b/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.css @@ -1,4 +1,9 @@ .just-testing { - background-color: red; - color: yellow; + background-color: rgb(202, 255, 255); + color: rgb(82, 0, 78); +} + +.just-testing a { + background-color: rgb(202, 255, 255); + color: rgb(10, 0, 104); } \ No newline at end of file diff --git a/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.js b/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.js index a294bfb25..63520367e 100644 --- a/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.js +++ b/packages/app-cli/tests/support/plugins/content_script/src/markdownItTestPlugin.js @@ -6,7 +6,13 @@ function plugin(markdownIt, _options) { 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 `
JUST TESTING: ${token.content}
+ + +