Simple post syntax-highlighted code using the EnlighterJS MooTools Plugin.
This problem is caused by WordPress'
wpAutoP filter - to fix this issue, go to "Enlighter Settings -> Advanced -> WpAutoP Filter Priority" and change this value to "Priority 12 (after shortcode). For cross-plugin-compatibility this feature is disabled by default.
You have to enable the full toolbar by clicking on the Show/Hide Kitchen Sink button (last icon on the toolbar)
/wp-content/plugins/enlighter/cache/ must be writeable - the generated css files as well as some cached content will be stored there for performance reasons. Try to set chmod to
wp-content/plugins/enlighter/cache have to be writeable, the generated stylesheet will be stored there. Set the directory permission (chmod) to
This feature requires WordPress 3.9 (new TinyMCE Version) - but you can still use shortcodes for inline highlighting!
The use of Shortcode is only recommended when working in Text-Mode. By switching to the Visual-Editor-Mode whitespaces (linebreaks, indents, ..) within the shortcode will get removed by the editor - using Visual-Editor mode will avoid such problems.
To enable the Theme-Customizer you have to select the theme named Custom as default theme. The Theme-Customizer will appear immediately.
Yes! since version 1.5 all shortcodes support the attribute
Shortcode Example: highlight the lines 2,3,4,8 of the codeblock
[js highlight="2-4,8"]....some code..[/js]
The complete EnlighterJS project can be found on GitHub
Yes you can! - The simplest way is to download the EnlighterJS CSS sources and modify one of the standard themes. Finally create a directory named
enlighter into your WordPress theme and put the css file into it.
You have to enable the frontend editing function:
Enlighter Settings Page -> Advanced -> TinyMCE Integration (Visual Editor) -> Enable Frontend Integration. This feature also requires a logged-in user with
edit_pages privileges and is only available for the
wp_editor function - no thrid party editors are supported!
If you are already using MooTools on your page, you have to disable the automatic inclusion of MooTools by Enlighter. Goto the Enlighter options page -> Advanced and select "Not include" as MooTools source. Note: EnlighterJS requires MooTools > 1.4
In case you found a security issue in this plugin - please write a message directly to Andi Dittrich - DO NOT POST THIS ISSUE ON GITHUB OR WORDPRESS.ORG - the issue will be public released if it is fixed!