partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
247 stars 61 forks source link

Moodle Spectrum display issue #297

Open registerme1963 opened 1 year ago

registerme1963 commented 1 year ago

This is in continuation of earlier issue: https://github.com/partridgejiang/Kekule.js/issues/269 The structure insert is working well. No need to edit moodle/lib/weblib.php. However, the spectrum tags are stripped by the moodle.

any solution regards

registerme1963 commented 1 year ago

If I change as SPECTRUM_INSPECTOR_CLASS: 'KekuleChemObjViewer' in button.js then the spectrum display seems to be good. No stripping is done. Is it okay to change it?

regards

partridgejiang commented 1 year ago

Hi @registerme1963, its a quite confuzing problem. Generally, Moodle will not run a HTML content filter based on certain class names. In my own test, the spectrum with class name KekuleSpectrumInspector can also be outputed successfully in my test site (Moodle 4.0.4). However, changing such a class name should not do any harm. So it may be a safe and quick work-around, :).

registerme1963 commented 1 year ago

The issue comes only in forum posts. In others it works with class name KekuleSpectrumInspector. I'm also in Moodle 4.0.4 Thanks for reassurance. regards