laughinghan/tinymce_mathquill_plugin

Transform mathquill-rendered-math spans back to images when loading into editor

piacentini opened this issue · 2 comments

When you get the tinymce.html() contents the plugin transforms the image (used for preview) into mathquill-rendered-math spans. However, the opposite does not happen. So when you store the text in a database or another place and then reload the equation in the plugin, you will not see the preview images and will not be able to edit the equations (they will be loaded as mathquill-rendered-math spans in tinymce).
ASCIIMath plugin apparently toggles between AM and AMEdit spans in the preProcess method of the plugin, for reference.

There are also ed.onLoadContent, ed.onSetContent and ed.onBeforeSetContent. Maybe these are more appropriate for the transformation.

I fixed it in master, please check.