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

fix strikeThrough service

parent 0adb1e27
No related branches found
No related tags found
1 merge request!45Develop
......@@ -17,8 +17,7 @@ export default class StrikeThrough extends Tools {
get active() {
return state => {
console.log(state.config);
// return markActive(state.config.schema.marks.strikethrough)(state);
return markActive(state.config.schema.marks.strikethrough)(state);
};
}
}
import Service from "wax-prosemirror-core/src/services/Service";
import { strikethroughMark } from "wax-prosemirror-schema";
import StrikeThrough from "./StrikeThrough";
console.log(strikethroughMark);
class StrikeThroughService extends Service {
register() {
this.container.bind("StrikeThrough").to(StrikeThrough);
......@@ -9,7 +8,7 @@ class StrikeThroughService extends Service {
this.container
.bind("schema")
.toConstantValue({
em: strikethroughMark
strikethrough: strikethroughMark
})
.whenTargetNamed("mark");
}
......
......@@ -31,7 +31,7 @@ export default class ParseRule {
return omit(hooks, ["dom"]);
};
}
console.log(rule, "rule");
return rule;
}
......
......@@ -12,8 +12,12 @@ export default class Schema {
schema = null;
constructor(
@multiInject("schema") @named("mark") marks,
@multiInject("schema") @named("node") nodes
@multiInject("schema")
@named("mark")
marks,
@multiInject("schema")
@named("node")
nodes
) {
this.setNodes(nodes);
this.setMarks(marks);
......@@ -94,10 +98,10 @@ export default class Schema {
nodes[index] = this._nodes[index].toJSON();
}
console.log(this._marks);
for (let index in this._marks) {
marks[index] = this._marks[index].toJSON();
}
this.schema = new PmPschema({ nodes, marks });
return this.schema;
}
......
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