πŸ‡ΈπŸ‡ͺSweden @mrzoom

Account created on 5 October 2023, about 1 year 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.71.5 2024