- Issue created by @Daniel Kulbe
- Status changed to Needs review
almost 2 years ago 12:44pm 7 February 2023 - Status changed to Needs work
almost 2 years ago 2:53pm 8 March 2023 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
inheritsCKEditor5PluginConfigurableInterface
( 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.
- last update
over 1 year ago 2 fail - 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.
- 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 withUncaught 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
. - 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.