The next big thing

Created on 7 February 2023, almost 2 years 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

Active

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

Merge Requests

Comments & Activities

  • Issue created by @Daniel Kulbe
  • Merge request !3Issue #3339936: The next big thing โ†’ (Open) created by Daniel Kulbe
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Daniel Kulbe Berlin
  • Status changed to Needs work almost 2 years 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 over 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 over 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 over 1 year ago
    2 fail
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland colorfield Lausanne

    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 over 1 year ago
    2 fail
  • First commit to issue fork.
  • ๐Ÿ‡ฏ๐Ÿ‡ตJapan andrechun

    Rebased the branch with 4.x, it had issues with trying to apply patch to current latest changes in 4.x branch due to merge conflict with README.txt.

Production build 0.71.5 2024