Support » Plugin: Enlighter - Customizable Syntax Highlighter » Switching between visual/text editor is broken loading code

  • Resolved Nikodemsky

    (@nikodemsky)


    So i just tried this plugin and i really loved it, just have two problems right now.

    1. Visual editor does not work at all. I have few other plugins installed, but this problem occured specificaly after this plugin activation. I’m using text editor mostly and for me it’s not a big deal, but some of my coworkers using visual editor and… there is a problem i guess.

    2. When i’m loading page i’m seeing something weird – it’s like it tries to load between few different css styles, the “right” one is loaded at the end, but i’m a bit concerned, that it might cause longer page loads with more content – i’m using enlighter theme atm. Not sure if it’s problem caused by other plugins or just this one.

    thanks in advance.

    https://wordpress.org/plugins/enlighter/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Andi Dittrich

    (@andi-dittrich)

    Dear Nikodemsky,
    thank’s for your contribution. i believe your problems caused by a conflict with another plugin(s).

    1. withouot a specific description, screenshots or a testpage/testcase – i cannot figure out what’s going wrong. generally there are no text-tansforms or any other action applied when switching between text/visual mode. Enlighter just enables the second toolbar and add’s the two additional buttons to the first toolbar – no other changes happens to the editor.

    2. could you please provide an example ? EnlighterJS first loads the basic css styles which got overriden by the selected theme – maybe there is a conflict with additional stylesheets..

    best regards, Andi

    1. So if i activate plugin and try to edit it with visual editor it looks like this:
    http://s23.postimg.org/tz7t3ucuz/1212.jpg

    then if ill try to switch to text editor it looks like this:
    http://s16.postimg.org/mx8n09ned/131313.jpg

    as you can see there’s 5 words but editor shows none and i can’t edit this page.

    I need to click on text editor, close editor, then click edit on page again, to even have possibility to edit page.

    2. While loading page it looks like this:
    http://s28.postimg.org/hg2lde471/load1.jpg

    then after 1-2 seconds it looks ok:
    http://s28.postimg.org/rrey61vwd/load2.jpg

    I’m using arconix shortcodes also – it was using [code] shortcode, but i filtered it in functions already.

    I can give list of plugins i'm using, if it helps.

    * I'm using latest version of WP.

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    Ok it looks realy bad…i tried “arconix shortcodes” togehter with Enlighter and everything works out of the box.

    The issue of delayed loading can be caused by to much css/js files on your page – enlighter is using the javascript based EnlighterJS plugin to provide the syntax-highlighting.

    It would be great if you can give me list of you plugins. One of them will crash the editor/enlighter-editor-plugin

    Ok so there’s list of plugins i’m using:

    Active:
    * Arconix Shortcodes
    * Contact form 7
    * Custom Meta Widget
    * WordPress Download Manager Pro
    * Drop Shadow Boxes
    * Easy Fancybox
    * Post Layout
    * RAW html
    * Smooth Scroll Up
    * Sweet Captcha
    * Tablepress
    * TwentyTwenty
    * UK Cookie Consent
    * User Role Editor
    * WordPress SEO(Yoast)
    * WP-Syntax(i already tried disabling this one)
    * WPDM – Archive Page(WordPress Download manager extension)
    * WPDM – Image Button(WordPress Download manager extension)

    Inactive:
    * Enlighter
    * Optimize Database after Deleting Revisions
    * TablePress Extension: Responsive Tables
    * WP Super Cache(i removed and disabled all caching functions)

    i know it’s hard to belive, but i’m actually need all of those(maybe except Raw html, but i need to rebuild content to remove this one) 🙂

    and error from dev console:
    http://s14.postimg.org/jj4z5ll29/console1.png

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    Dear Nikodemsky,

    i’ve tried to reproduce the plugin-conflict but everything works fine.

    But thanks to your console screenshot i could figure out what happens to the visual editor:
    The Enlighter-Visual-Editor plugin requires a global javascript config object Enlighter which is loaded by WordPress’ admin_print_scripts hook.
    In your case (i don’t know why) it is blocked. This will cause an “Unknon Reference Error” (object is missing) and the TinyMCE editor will crash.

    If you like to use Enlighter you can download the hardened TinyMCE.js file from here: http://dev.a3non.org/TinyMCE.js
    Replace it with the old version located in wp-content/plugins/enlighter/resources/admin/TinyMCE.js.
    This will avoid the visual editor to crash when the Enlighter configuration object is not available. This means you can use the enlighter shortcodes but the Visual-Editor mode won’t work.

    Maybe the first error in your console will cause the missing object (parsing error). Is there any code like <script type="text/javascript">/* <![CDATA[ */var Enlighter = {langu... in the html-head section of the edit post page? If not, the admin_print_scripts hook seems to be disabled.

    best regards, Andi – and many thanks for this report!

    Thanks for the fix, once i replaced TinyMCE everything works as it should(visual editor too) 🙂

    About the last part, there’s line at the head section:
    <script type="text/javascript">/* <![CDATA[ */var Enlighter = {languages: {"CSS (Cascading Style Sheets)":"css","HTML (Hypertext Markup Language)":"html","Java":"java","Javascript":"js","Markdown":"md","PHP":"php","Python":"python","Ruby":"ruby","Shell Script":"shell","SQL":"sql","XML":"xml","C":"c","C++":"cpp","C#":"csharp","NSIS":"nsis","Diff":"diff","RAW":"raw","No Highlighting":"no-highlight","Generic Highlighting":"generic"}, themes: {"Enlighter":true,"Beyond":true,"Classic":true,"Eclipse":true,"Git":true,"Mocha":true,"MooTools":true,"Panic":true,"Tutti":true,"Twilight":true}, config: {theme: "enlighter", language: "xml", linenumbers: , indent: 1}};/* ]]> */</script>

    Should i be worried about it?

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    No, everything seems to be ok 😉

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Switching between visual/text editor is broken loading code’ is closed to new replies.