slate-plugins icon indicating copy to clipboard operation
slate-plugins copied to clipboard

Auto-Replace Add Mark Bug.

Open jad-eljerdy opened this issue 6 years ago • 1 comments

Do you want to request a feature or report a bug?

Bug.

What's the current behavior?

No Marks are being rendered with autoreplace. Text is showing up but not with BOLD mark. No marks are rendered at all.

If you type BEFORE the text manually, the text is bold.

What's the expected behavior?

Marks should render.

const plugins = [
            AutoReplace({
                trigger: '*',
                before: /(\*{1}(.+?))$/,
                change: (change, e, matches) => {
                    var match = [...matches.before].pop()

                    return change
                        .addMark('bold')
                        .insertText(match)

                }
            }),

        ]

Doing this should insert BOLD text. That's not the current behavior. Anyone else experiencing this ?

jad-eljerdy avatar Jul 07 '19 18:07 jad-eljerdy

Not sure, but depending on the Slate version your using, it seems to me that this plugin isn't compatible with Slate 0.5+ anymore 😢

CanRau avatar Jan 01 '22 18:01 CanRau