Giter VIP home page Giter VIP logo

Comments (1)

i-just avatar i-just commented on May 27, 2024 1

Hi, thanks for getting in touch. It looks like this is the default behaviour coming from CKEditor v5: https://github.com/ckeditor/ckeditor5/blob/dff5e8cd5432c67efab052d30f02fb6c6b37ffcb/packages/ckeditor5-heading/_src/heading.js#L52-L81

You can change it by adding your custom configuration in the field settings under Initialization Code. The following snippet would change the default behaviour to map Heading 1 to h1, Heading 2 to h2 etc and would add Heading 4 to the list:

return await ClassicEditor
    .create(document.querySelector('#__EDITOR__'), {
        heading: {
            options: [
               { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
               { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
               { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
               { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
               { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' }
           ]
       }
    });

This is a good starting point if you’re looking for ways to customise your editor: https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start.html#sample-implementation-2

from ckeditor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.