diff --git a/wax-prosemirror-core/src/Application.js b/wax-prosemirror-core/src/Application.js index 40916f3a4d93c55beecf018b728cb1c924deb7d6..02ed531933a540ee7eeb96303333ee92a08797a1 100644 --- a/wax-prosemirror-core/src/Application.js +++ b/wax-prosemirror-core/src/Application.js @@ -66,7 +66,7 @@ export default class Application { static create(config) { /* Merge Core Config with User Config */ - const appConfig = deepmerge({ config: defaultConfig }, config, { + const appConfig = deepmerge({ config: defaultConfig() }, config, { customMerge: key => { if (key === 'services') { return (coreService, configService) => { diff --git a/wax-prosemirror-core/src/Wax.js b/wax-prosemirror-core/src/Wax.js index ccff04147b5cf50860916025e099d4e8086294f9..fb2a468a49f3dd5f53dabbf52299ab651121155c 100644 --- a/wax-prosemirror-core/src/Wax.js +++ b/wax-prosemirror-core/src/Wax.js @@ -31,10 +31,9 @@ const serializer = schema => { }; }; -let schema; const createApplication = props => { const application = Application.create(props); - schema = application.getSchema(); + application.getSchema(); application.bootServices(); return application; }; @@ -68,7 +67,7 @@ const Wax = props => { } = props; if (!application) return null; - + const { schema } = application.schema; const WaxOnchange = onChange ? onChange : value => true; const editorContent = value || ''; @@ -88,7 +87,7 @@ const Wax = props => { const finalOnChange = debounce( value => { - /*HACK alter toDOM of footnote, because of how PM treats inline nodes + /* HACK alter toDOM of footnote, because of how PM treats inline nodes with content */ if (schema.nodes.footnote) { const old = schema.nodes.footnote.spec.toDOM; diff --git a/wax-prosemirror-core/src/config/defaultConfig.js b/wax-prosemirror-core/src/config/defaultConfig.js index c7f9a3726116ee557093a296e8b58213931cd71c..662a9b2de013a8f1929998cd799b27be3d98147f 100644 --- a/wax-prosemirror-core/src/config/defaultConfig.js +++ b/wax-prosemirror-core/src/config/defaultConfig.js @@ -7,7 +7,7 @@ import { OverlayService, } from 'wax-prosemirror-services'; -export default { +export default () => ({ services: [ new SchemaService(), new RulesService(), @@ -16,4 +16,4 @@ export default { new MenuService(), new OverlayService(), ], -}; +});