Auto-replace Example Broken
wootencl opened this issue ยท 2 comments
Looks like the auto replace example is borked. Tried to track down the issues myself to no avail ๐. Seems that change
is not being passed in as an argument to the plugin for one reason or another. Looks like it's being passed in taking a peak at slate-react
's source but I'm also super new to the slate architecture so could be something obvious going wrong elsewhere.
/cc @ianstormtaylor
Ran into this as well. Just wanted to call out that it's broken on the demo page as well: https://ianstormtaylor.github.io/slate-plugins/#/slate-auto-replace
I've tracked down the problem to this commit :
ddfc5e9#diff-381f85095197bcecc10eb6424caa4281
Seems like @ianstormtaylor have changed the transform
parameter to change
in index.js
. However, for some reasons he forgot to update the Auto-Replace demo.
so calling the plugin like this should work :
plugins = [
AutoReplace({
trigger: ')',
before: /(\(c)$/i,
change: transform => transform.insertText('ยฉ')
}),
]