Created on 21 May 2020, about 4 years ago
Updated 30 June 2023, 12 months ago

How come nesting isn't allowed? I see in the code it's purposely disabled just curious as to why?

πŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smustgrave

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States liut

    Thanks for creating this issue. Has anyone since looked into adapting this for CKEditor5?

    To allow nesting accordion into accordionContent, it looks like it's being prevented by this in accordionediting.js:

        schema.addChildCheck((context, childDefinition) => {
          // Disallow accordion inside accordionContent.
          if (
            context.endsWith('accordionContent') &&
            childDefinition.name === 'accordion'
          ) {
            return false;
          }
        });
    

    I've tried removing this and returning true but it hasn't worked for me. Also tried messing with some schema rules allowIn allowWhere allowContentOf to be able to insert accordion into accordionContent but no luck. Maybe I've got the wrong idea and I'm missing something.

  • πŸ‡ΊπŸ‡ΈUnited States liut

    I realized I needed to re-build the ckeditor-accordion webpack to apply changes. This can be done using yarn or npm. You'll need to make sure to build after you make any changes to the plugins.

    With that being said, I commented the lines from the code segment above in accordionediting.js and nested functionality is working for CKEditor5. I'll add a patch.

    Anyone who knows more about this module feel free to edit a better solution if there is one.

  • πŸ‡ΊπŸ‡ΈUnited States liut

    patch now includes build/accordion.js file

Production build 0.69.0 2024