The next big thing

Created on 7 February 2023, over 1 year ago
Updated 20 September 2023, 9 months ago

Problem/Motivation

I'm tired of not being able to use some good improvements from the issue queue together, I want the next big thing.

Steps to reproduce

I want to make those work perfectly together:

Plus some further improvements:

  • Define the MathJax common configuration to load, even when I do not use it from CDN
  • Add support for CKEditor 5 MathJax plugin

Proposed resolution

Merge the linked MR in favour of the issues above.

Remaining tasks

There are two open PRs for the CKEditor 5 plugin, to make it work with Drupal's CKEditor 5 implementation:

To make it work already, I created pre-releases, of which the latest is linked in the code:
https://github.com/DanielKulbe/ckeditor5-math/releases

Data model changes

  • common_config setting added
Feature request
Status

Needs work

Version

4.0

Component

Code

Created by

🇩🇪Germany Daniel Kulbe Berlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Daniel Kulbe
  • @daniel-kulbe opened merge request.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • Hi 👋,

    I was looking into math input modules for CKEditor5 and found this. Great work! Here are some fixes/feedback/opinions (especially related CKEditor5):

    • - CKEditor5PluginElementsSubsetInterface inherits CKEditor5PluginConfigurableInterface ( https://www.drupal.org/project/drupal/issues/3246012 )
    • > Why not hard code the classname so that the subset code and form code could be removed? Anyway, my patch just adds the the missing methods to make the plugin class work.
    • - Error: Class "Drupal\ckeditor\CKEditorPluginBase" not found if ckeditor4 is not installed.
    • > Added ‘provider’ definitions: https://drupal.stackexchange.com/questions/299020/how-can-i-let-a-plugin...
    • - CKEditor5 plugin id must start with ckeditor5_
    • - Fixed few typos
    • - I think the form page should always include the library since it contains test markup.
    • - mathjax_editor_js_settings_alter: The condition was never true for CKEditor5
    • - CKEditorError: plugincollection-soft-required {"missingPlugin":"Autoformat","requiredBy":"AutoformatMath"}
    • > I believe AutoformatMath requires: https://www.npmjs.com/package/@ckeditor/ckeditor5-autoformat as a dependency
    • > I removed AutoformatMath from CKEditor5Plugin for now to stop the editor from crashing.
    • - Something in the js (?) sets the CKEditor generated span element to: <span class=“undefined”>.

    I was not able to get this fully working yet, but it is quite close.

  • 🇩🇪Germany Daniel Kulbe Berlin

    Hey, thanks for the feedback, I incorporated most of it into the branch.

    > Why not hard code the classname so that the subset code and form code could be removed? Anyway, my patch just adds the the missing methods to make the plugin class work.

    Because, as I mentioned in the description, there is an open PR on GitHub which allows to configure the classname of the element. I'm currently working on a project where exactly this is a required thing.

    > mathjax_editor_js_settings_alter: The condition was never true for CKEditor5

    Yes, because this is how the CKEditor4 plugin works. It is not required for the CKEditor5 plugin.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    2 fail
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    2 fail
  • Hey there,

    I've tried out these changes and the interface is working great :)

    I did need to make a few small tweaks to CKEditor5Plugin/Mathjax.php though:

    • The 'provider' annotation should be up one level, outside of @DrupalAspectsOfCKEditor5Plugin
    • There are still some methods missing for CKEditor5PluginElementsSubsetInterface (I just removed the implements)
    • I had to remove the call to 'getElements' on line 89 (getPluginDefinition was returning an array directly)
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 9 months ago
    2 fail
  • 🇧🇪Belgium colorfield Brussels

    Thanks for the great work! Added defer to the plugin in libraries as the editor can error with

    Uncaught TypeError: can't access property "config", settings.mathjax is undefined
    CKEditorError: plugincollection-plugin-not-found {"plugin":null}

    when JS aggregation is set $config['system.performance']['js']['preprocess'] = TRUE.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 9 months ago
    2 fail
Production build 0.69.0 2024