πŸ‡ΈπŸ‡ͺSweden @mrzoom

Account created on 5 October 2023, 8 months ago
#

Recent comments

πŸ‡ΈπŸ‡ͺSweden mrzoom

After some more digging, I think this is related to this issue:
https://github.com/ckeditor/ckeditor5/issues/1068

Where a "soft-break" (<br>) is handled the same way.

I don't know how to create a path... But by adding:
allowAttributesOf: '$text'

To your schema like this:

_defineSchema() {
    this.editor.model.schema.register("shy", {
        allowWhere: "$text",
        isInline: !0,
        allowAttributesOf: '$text'
    })
}

And change your execute() method to this:

class t extends e.Command {
    execute() {
        this.editor.model.change((e => {
            const r = e.createElement('shy', this.editor.model.document.selection.getAttributes());
            this.editor.model.insertContent(r)
        }))
    }
}

Then the <shy> element is inserted inside for example <strong>, instead of breaking the text in to two separate <strong> element.

Production build 0.69.0 2024