Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CKEditor 5] TypeError thrown when using MathType in combination with TextPartLanguage #910

Open
mabryl opened this issue Mar 5, 2024 · 1 comment
Labels
type:bug Something isn't working

Comments

@mabryl
Copy link

mabryl commented Mar 5, 2024

Description

What does the bug consist in?

When MathType and TextPartLanguage are included in the same build, using the MathType plugin will result in the following error being thrown:

editor?lang=[object%…ersion=8.8.2.1481:1 Uncaught TypeError: language.toLowerCase is not a function
    at com.wiris.editor.EditorModel.vm2.com.wiris.editor.EditorModel.normalizeLanguage

Removing either of the plugins resolves the issue, which seems to suggest that there is some conflict between these plugins.

Environment

Which version of MathType does this happen in?

wiris/mathtype-ckeditor5": "8.8.0

What is the relevant software and their versions?

  • Editor (CKEditor, Froala, TinyMCE, etc.): CKEditor 5 v41.1.0
  • Framework (Angular, React, etc.): none
  • Browser (Chrome, Firefox, etc.): cross-browser
  • Operating System (Windows, macOS, Ubuntu, etc.): macOS Sonoma 14.3.1 (23D60)

Steps to reproduce

What are the steps needed to reproduce the bug?
Please be specific.

Download ckeditor5-math-lang-test.zip and run e.g. http-server in its root directory.

Then, access the index.html file contained in the sample directory via the server.

Finally, try to insert a formula via MathType.

Expected result

No errors should appear.

Actual result

Errors thrown in the console.

Other details

Is there anything else to consider?

@mabryl mabryl added the type:bug Something isn't working label Mar 5, 2024
@carla-at-wiris
Copy link
Contributor

Hi @mabryl, thank you for reporting this!

We indeed have an issue in how we treat the language that is creating these conflicts. We sent the issue to the next step, and you'll be informed once we release a fix for it.

In the meantime, setting a language for the MathType Editor, provides a temporary fix, here's an example:

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        ...
        mathTypeParameters: {
            editorParameters: { language: 'en' }, // MathType configuration
        },
    } )
    .then( editor => {
        ...
        window.editor = editor;
    } )
    .catch( err => {
        ...
        console.error( err.stack );
    } );

We hope this can help while we work on a permanent fix. Any further issues, please feel free to contact us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants