Search code examples
pluginsckeditormagicline

How to configure CKEditor for Magic Line to activate on other elements?


I've read the Magic Line plugin documentation but I'm not sure how to add more HTML elements for the plugin to activate with e.g. <section>

enter image description here

I see a way to configure it to activate on all elements:

CKEDITOR.config.magicline_everywhere = true;

And then to blacklist some elements:

CKEDITOR.config.magicline_tabuList = [ 'data-tabu' ];

But unsure how to add to the existing default list of HTML elements.

Thanks!


Solution

  • That isn't possible...from looking at the source code https://github.com/ckeditor/ckeditor4/blob/master/plugins/magicline/plugin.js

    ...it is clear that there is no way to configure/modify the triggers beyond them being either DTD_BLOCK (if magicline_everywhere is true) or else { table: 1, hr: 1, div: 1, ul: 1, ol: 1, dl: 1, form: 1, blockquote: 1 } if it is false.

    So there appears to be no way to set it to work with an arbitrary list of elements. Also as <section> is not a block level element it wouldn't work even if you could add it.