Support » Plugin: HTML Editor Syntax Highlighter » Clashes with Scripts n Styles Plugin

  • Resolved wutever0


    Hi would it be possible to check why this does not work when the Scripts n Styles Plugin is installed and activated?
    Given that the fact that having custom scripts and styles goes hand in hand with editing page HTML directly, and that the Scripts n Styles plugin is currently the most popular of all page-specific script and style plugin, would love them to work together.

    The page HTML editor simply does not change (works as if it were the regular page WordPress Text Editor) although other editors (Appearance > Editor) work.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi, I’m the author of the Scripts n Styles plugin. What kind of clash is happening? It might be a conflict in the versions of CodeMirror, which is now bundled with WordPress Core. I’ll put it on my list to investigate whether SnS is causing the issue or not.

    Hi Kenny,

    I can confirm that HTML Editor Syntax Highlighter does not work if your Scripts n Styles plugin is enabled. With both plugins enabled at the same time, you just get the regular WP text editor with no editor highlighting. If you then disable Scripts n Styles, HTML Editor Syntax Highlighter works as expected.

    I have exactly the same problem, any solutions found for it yet?
    I really need both plugins at the same time.

    I’ve looked into this, and it appears there is a check in HTML Editor Syntax Highlighter that looks to see if any element already has the css class CodeMirror and won’t start the plugin if so. The plugin looks to support only 1 CodeMirror instance per page.

    Thanks Kenny. Do you have any idea why this is the case? Is that check necessary? Do you think that there could be two instances in one page?

    Would Scripts ‘n Styles still work if HTML Editor Snytax Highlighter was indeed operating?

    Can you make any suggestions to the HTML Editor Snytax Highlighter authors that might resolve this conflict?

    On your end, any chance of making syntax highlighting an on/off setting option in Scripts ‘n Styles? Or perhaps having a “none” option under Code Mirror > theme which would disable code mirror?

    • This reply was modified 1 year, 4 months ago by hommealone.

    As for the plugin that’s not mine, it’d have to be re-written a bit to support multiple instances. And while they’re at it, probably use the built-in version. That isn’t a small task tho; I’m currently re-writing Scripts-n-Styles to do the same, but it’s not ready yet. The advantage is, that if we use the built-in CodeMirror, it should work with multiple instances, and also be disabled via user-settings. I’m hoping to have my update out by WordPress 5.0

    Thanks Kenny. Good to know that this is in the works for Scripts ‘N Styles.

    Hopefully the authors of HTML Editor Syntax Highlighter will read this post (no indication yet that they have) and aim for the same thing.

    Thank you Kenny for your time in following up on this and developing it.

    Plugin Author James Bradford


    thanks @wraithkenny
    I’m working on support for this. It’s tracked here

    Thanks @arniebradfo

    Both plugins are working together again after your last release. Much appreciated!

    Thank you very very much. It’s working perfectly again and it’s a lifesaver for me since I always use text editor to input html manually and it gets impossible to read code inside raw text editor after a while.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Clashes with Scripts n Styles Plugin’ is closed to new replies.