etal2 / ContentTools-Codemirror

ContentTools Codemirror html editor integration
0 stars 0 forks source link

Code Highlighting #1

Open bananenklops opened 6 years ago

bananenklops commented 6 years ago

First I have to say a big thank you for sharing this. It helps me a lot.

Everything works so far, but i have no code highlighting.

the codemirror_config in your content-tools-codemirror.js uses the 'htmlmixed' mode, so I included mode/htmlmixed/htmlmixed.js, but there is still no HTML highlighting.

I included the js files in the following order:

  1. htmlmixed.js
  2. content-tools.js
  3. codemirror.js
  4. content-tools-codemirror.js
  5. editor.js (i just load the translation files for content-tools in there)

I also have a second problem: i have two of the buttons for html editing, as you may see here: screenshot-2018-5-22 http 192 168 178 34

Thank you for any answer.

etal2 commented 6 years ago

To get htmlmixed working you have to include: mode/xml/xml.js mode/javascript/javascript.js mode/css/css.js before including htmlmixed.js and you need to include codemirror.js first (at least that's what I do). My config also uses addon/edit/matchbrackets.js and addon/selection/active-line.js but these are not required.

As for the double icons maybe you are addding the icon twice somehow? I'm not sure what is going wrong and I'm not able to debug it just from a picture.