Skip to content
Snippets Groups Projects
Commit d7716a4d authored by chris's avatar chris
Browse files

remove example of adding a rule from another service

parent 06934c96
No related branches found
No related tags found
1 merge request!45Develop
......@@ -13,7 +13,7 @@ export default {
],
RulesService: [
{
rules: [ellipsis]
rules: [emDash, ellipsis]
}
]
};
......@@ -51,11 +51,9 @@ class Wax extends Component {
const { value, onChange, options } = this.props;
const { schema, plugins, keys, rules } = options;
const WaxOnchange = onChange ? onChange : value => true;
this.application.bootServices();
// const WaxShortCuts = keys
// ? keys
// : new CreateShortCuts({ schema: schema, shortCuts: {} });
const editorContent = value ? value : "";
if (plugins) defaultPlugins.push(...plugins);
......@@ -64,7 +62,7 @@ class Wax extends Component {
placeholder({ content: this.props.placeholder }),
...this.application.getPlugins()
]);
console.log("cretated?");
this.WaxOptions = {
schema,
plugins: finalPlugins
......
import Service from "wax-prosemirror-core/src/services/Service";
import placeholderPlugin from "./pmPlugins/placeholderPlugin";
const PLUGIN_KEY = "imagePlaceHolder";
import { emDash } from "prosemirror-inputrules";
export default class PlaceholderService extends Service {
name = "PlaceholderService";
register() {
const rules = this.container.get("Rules");
rules.addRule([emDash]);
this.app.PmPlugins.add(PLUGIN_KEY, placeholderPlugin(PLUGIN_KEY));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment