Trying to get codehighlighting-for-TinyMCE working with tinymce-rails

290 views Asked by At

I'm using the tinymce-rails in my Ruby on Rails application and I wanted to add syntax highlighting to TinyMCE then i found this plugin https://github.com/grena/codehighlighting-for-TinyMCE and added it to app/assets/javascript/tinymce/codehighlighting. also added to tinymce.yml like this:

theme_advanced_buttons3_add:
  - codehighlighting
plugins:
  - codehighlighting

but when I load the view with the form with tinymce I get:

TypeError: 'undefined' is not an object (evaluating 'ed.onNodeChange.add')

Did I something wrong ? or the plugin is not up to date?

1

There are 1 answers

0
Dzung Nguyen On

You cannot add the plugin just like that since tinymce-rails only uses plugins included in the gem. You can find it here : https://github.com/spohlenz/tinymce-rails/tree/master/vendor/assets/javascripts/tinymce/plugins

So it's better that you should suggest the owner of this gem add your plugin, or better make a fork, add your plugin there and send a PR to them. It should work.