ianstormtaylor/slate-plugins

Auto-Replace Add Mark Bug.

jad-eljerdy opened this issue · 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 ?

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 😢