$(function() { (function (prosemirrorState, prosemirrorView, prosemirrorModel, prosemirrorSchemaBasic, prosemirrorSchemaList, prosemirrorExampleSetup) { 'use strict'; // init prosemirror // Mix the nodes from prosemirror-schema-list into the basic schema to // create a schema with list support. let mySchema = new prosemirrorModel.Schema({ nodes: prosemirrorSchemaList.addListNodes(prosemirrorSchemaBasic.schema.spec.nodes, "paragraph block*", "block"), marks: prosemirrorSchemaBasic.schema.spec.marks }); let createBeyondGrammarPluginSpec = window["BeyondGrammar"].createBeyondGrammarPluginSpec; let spec = createBeyondGrammarPluginSpec(PM, document.getElementById("editor"),{ service : { apiKey : "E8FEF7AE-3F36-4EAF-A451-456D05E6F2A3", serviceUrl: "//rtg.prowritingaid.com", sourcePath : "//cdn.prowritingaid.com/beyondgrammar/2.0.2893.1/dist/hayt/bundle.js" }, grammar : {} }); let plugin = new prosemirrorState.Plugin( spec ); spec.editorView = new prosemirrorView.EditorView(document.getElementById("editor"), { state: prosemirrorState.EditorState.create({ doc: prosemirrorModel.DOMParser .fromSchema(mySchema) .parse(document.getElementById("content")), plugins: prosemirrorExampleSetup .exampleSetup({schema: mySchema }) .concat( plugin ) }) }); }(PM.state, PM.view, PM.model, PM.schema_basic, PM.schema_list, PM.example_setup))});
<link rel=stylesheet href="https://prosemirror.net/css/editor.css"> <script src="https://prosemirror.net/examples/prosemirror.js"></script> <script src="https://prowriting.azureedge.net/beyondgrammar-prosemirror/1.0.38/dist/beyond-grammar-plugin.js"></script> <div style="display: none;" id="content"> <h3>Hello ProseMirror</h3> <p>This is editable text. You can focus it and start typing.</p> <p>To apply styling, you can select a piece of text and manipulate its styling from the menu. The basic schema supports <em>emphasis</em>, <strong>strong text</strong>, <a href="http://marijnhaverbeke.nl/blog">links</a>, <code>code font</code>, and <img src="http://prosemirror.net/img/smiley.png"> imagfes.</p> <p>Block-level structure can be manipulated with key bindings (try ctrl-shift-2 to create a level 2 heading, or enter in an empty textblock to exit the parent block), or through the menu.</p> <p>Try using the “list” item in the menu to wrap this paragraph in a numbered list.</p> </div> <div id="editor" spellcheck="true"></div>