sharpchi / moodle-filter_syntaxhighlighter

14 stars 10 forks source link

Support coursewise on/off #3

Closed lucaboesch closed 3 years ago

lucaboesch commented 6 years ago

Hi and thanks for your great plugin!

In Moodle there is the possibility to mark a plugin as "Off, but available". It then can be switched on on a course basis. filter_syntaxhighlighter_coursewise Lecturers who then want this filter can switch it on in their course whereas throughout the whole Moodle instance it is generally switched of. It seems to me that filter_syntaxhighlighter does not respect this setting. As soon as the filter is not set to "Disabeled", the syntax highlighting works everywhere, no matter if set to "On" or to "Off, but available". Please enquire this bug.

Many thanks again for your contribution.

Best, Luca

sharpchi commented 6 years ago

Hi Luca, thanks for the feedback. The issue isn't exactly to do with the filter, rather than the CSS picking up you using <pre><code></code></pre> tags. If the text you insert has those tags, the style sheets will still activate - remember all styles are loaded in the head. If you just use <pre> then the styles won't kick in.

Also, the filter really only does a filter on `` backtick notation and replaces them with

` tags. If you have the filter off and are using the backticks then the code isn't styled.