wiris / html-integrations

The official JavaScript library for MathType, the leading formula editor and equation writer for the web by Wiris
https://wiris.com/solutions/integrations/html-editors/
MIT License
76 stars 53 forks source link

TinyMCE 6+7 attempts to upload mathml image #955

Closed cdonnelly1992 closed 5 months ago

cdonnelly1992 commented 6 months ago

Description

When running the integration: mathtype-tinymce6, using either tinyMCE 6 or 7: the tinyMCE editor attempts to upload the wiris formula image instead of ignoring the image.

Environment

Which version of MathType does this happen in? mathtype-tinymce6 (8.8.3 and 8.9.0)

What is the relevant software and their versions?

Steps to reproduce

What are the steps needed to reproduce the bug?

Expected result

What is the expected outcome of the steps above? The tinyMCE uploadImage attempts to upload nothing as there is no image that needs to be uploaded

Actual result

What is the actual outcome of the steps above? TinyMCE attempts to upload the formula image

Other details

Is there anything else to consider?

Based on reading through tinyMCE's scanForImages, it seems that you guys have a couple "easy" solutions:

carla-at-wiris commented 5 months ago

Hello @cdonnelly1992, thank you for taking the time to report this!

We are currently preparing a new release and haven't had the time to look at your issue. We'll give you an answer shortly. Thank you for your understanding!

xjiang-at-wiris commented 5 months ago

Hi @cdonnelly1992, we wanted to let you know that we are still working on the issue you raised.

Additionally, we have another question: why don't you want TinyMCE to upload MathML images? The MathType editor plugin is designed to generate images corresponding to input formulas, so the behavior of the output formula is expected to be the same as regular images.

Is there any error or negative impact that leads you to not want to upload formula images?

cdonnelly1992 commented 5 months ago

When I ask tinyMCE for the content editor.getContent(), wiris turns the image into a mathML string, which is the output I'm expecting. When I call uploadImage, tinyMCE finds the placeholder image, attempts to upload it and then adds the image ALONG with the mathML to the content. I would imagine that one of the settings given to wiris or the wiris plugin would tell it to choose between outputting the image into tinyMCE's getContent method or outputting the mathML (not both).

xjiang-at-wiris commented 5 months ago

Hello, thank you for waiting.

After our investigation, we found that the function for uploading images, including Wiris formulas, is not a bug. As we mentioned before, they are treated as images, so we cannot rule out the possibility that other users may want to upload them.

Therefore, we currently do not plan to make changes. If you wish to skip Wiris formulas, you can add these filters to your project.

Thank you for using our service.

cdonnelly1992 commented 5 months ago

This isn't considered a bug even though in tinyMCE 5, your plugin prevented uploading of the images using one of these same filters?

xjiang-at-wiris commented 5 months ago

Hello, TinyMCE 5 has deprecated the images_dataimg_filter option, so we have removed this feature from the plugin in TinyMCE 6. As mentioned earlier, this change has significant implications, and we cannot guarantee that other users indeed need to upload Wiris formulas. Therefore, we currently do not plan to make changes in this regard.

We encourage you to continue customizing your upload filter in your workaround.

Thank you for your understanding.