A custom TinyMCE plugin for inserting merge tags (dynamic placeholders) into the editor content.
Compiled bundles include:
plugin.min.js→ IIFE bundle for use with TinyMCE external plugins
The plugin registers a TinyMCE toolbar button and menu item for inserting merge tags.
- Include the plugin as an external TinyMCE plugin (e.g.
external_plugins: { mergetags: '/plugins/mergetags/plugin.min.js' }). - Configure available tags via TinyMCE init options (
mergetags_list). - When used, the plugin inserts a placeholder like
{{first_name}}into the editor content. - Autocompletion is supported when typing
{{in the editor.
Example:
tinymce.init({
selector: '#editor',
external_plugins: {
mergetags: '/plugins/mergetags/plugin.min.js',
},
mergetags_list: [
{ title: 'First Name', value: 'first_name' },
{ title: 'Email', value: 'email' },
],
toolbar: 'mergetags',
});Install nodejs and yarn, then install the needed dependencies:
yarn install
Use the different yarn scripts for the development workflow:
yarn dev
yarn test
yarn lint
yarn fix
For building releaseable artifacts (library files) use:
yarn build
The releasable files are configured to be created under dist/.
To enable debug mode in the browser set sessionStorage.setItem('mo_debug', 1).
Test framework: vitest