Skip to content

fix: update demo with lastest tiny updates #1098

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

Open
wants to merge 1 commit into
base: release/KB-55180
Choose a base branch
from

Conversation

xjiang-at-wiris
Copy link
Contributor

@xjiang-at-wiris xjiang-at-wiris commented Apr 14, 2025

Description

Update the demo and documentation to include the workaround for using extended_mathml_elements, extended_mathml_attributes.

These changes are made to ensure that MathML generated by MathType works correctly during both editing and viewing in TinyMCE 7, following it's 7.8 release note.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update (changes to documentation only)

Checklist

  • My code follows the style guidelines of this project ( Run yarn lint to check)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • New and existing unit tests pass locally with my changes

How should be tested? (Manual or Automated Tests)

  1. Launch tinycme 7' demo.
  2. Try to add formulas with linebreak. For example:
    <math style="font-family:'Times New Roman'" xmlns="http://www.w3.org/1998/Math/MathML"><mi>A</mi><mi>B</mi><mo>=</mo><mi>A</mi><mi>C</mi><mo>,</mo><mspace linebreak="newline"/><mspace/><mspace/><mspace/><mspace/><mspace/><mspace/><mspace/><mspace/><mi>A</mi><mi>K</mi><mo>=</mo><mi>A</mi><mi>H</mi><mo>,</mo><mspace linebreak="newline"/><mspace/><mspace/><mspace/><mspace/><mspace/><mspace/><mspace/><mspace/><mi>B</mi><mi>K</mi><mo>=</mo><mi>C</mi><mi>H</mi><mo>&#xA0;</mo><mo>?</mo><mi mathvariant="normal">&#x3C0;</mi></math>
  3. Ensure the MathML is not sanitized

@@ -24,6 +24,11 @@ tinymce.init({
// This option prevents the DOMPurify library from filtering wiris MathML tags.
// It's necessary when you want to initialize the editor with a content that contains handwritten formulas.
allow_mathml_annotation_encodings: ["wiris", "application/json"],

// Those options are necessary to allow the additional MathML tags to be saved in the editor.
extended_mathml_elements: [ "semantics" ],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carla-at-wiris I know semantics issue is fixed by adding the allow_mathml_annotation_encodings property. But I think this is a simpler and more intuitive way to solve it.

How do you think?

Copy link
Contributor

@jgonzalez-at-wiris jgonzalez-at-wiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants