TinyMCE and syntax highlighting

TinyMCE and syntax highlighting

Stephan Robotta -
回帖数:2
Core developers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像

Hi,

Today we discovered that TinyMCE and the syntax highlighting plugin (https://moodle.org/plugins/filter_syntaxhighlighter) don't seem to get along very well. The TinyMCE has a feature to insert code via the menu Insert -> Code sample. This creates something like:

<pre class="language-markup"><code>my code here</code></pre>

The syntax highlighting plugin uses something like:

<pre><code class="lang-html">my code here</code></pre>

There is no chance to change the HTML syntax via the source code because the Tiny filters the class attribute in the code tag. How do you use TinyMCE with syntax highlighting?

Best regards, Stephan

回复Stephan Robotta

Re: TinyMCE and syntax highlighting

Helen Foster -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 Translators的头像

Hi Stephan,

Just making sure that you know about the code highlighting improvements in TinyMCE in Moodle 4.3 (see MDL-75963), as maybe it's no longer necessary to use a syntax highlighting plugin?