Giter Club home page Giter Club logo

prosemirror's Introduction

prosemirror

[ WEBSITE | ISSUES | FORUM ]

ProseMirror is a well-behaved rich semantic content editor based on contentEditable, with support for collaborative editing and custom document schemas.

The ProseMirror library consists of a number of separate modules. This repository just serves as a central issue tracker, and holds a script to help easily check out all the core modules for development.

The project page has more information, a number of examples and the documentation.

This code is released under an MIT license. There's a forum for general discussion and support requests, and the Github bug tracker is the place to report issues.

STOP READING HERE IF YOU'RE SIMPLY USING PROSEMIRROR. YOU CAN INSTALL THE SEPARATE NPM MODULES FOR THAT. THE INSTRUCTIONS BELOW ONLY APPLY WHEN DEVELOPING PROSEMIRROR!

Setting up a dev environment

Clone this repository, and make sure you have node and yarn (due to a string of issues with NPM 5, NPM is not currently supported) installed. Next, from the cloned directory run:

bin/pm install

This will fetch the submodules, install their dependencies, and build them.

The bin/pm script in this repository provides functionality for working with the repositories:

  • bin/pm build rebuilds all the modules

  • bin/pm watch sets up a process that automatically rebuilds the modules when they change

  • bin/pm status prints the git status of all submodules

  • bin/pm commit <args> runs git commit with the given arguments in all submodules that have pending changes

  • bin/pm test runs the (non-browser) tests in all modules

  • bin/pm push runs git push in all modules

  • bin/pm grep <pattern> greps through the source code for the modules for the given pattern

  • bin/pm dev-start starts a server that rebuilds the packages whenever their sources change, and exposes the demo (demo/*) under a webserver on port 8080

(Functionality for managing releases will be added in the future.)

Community

Development of ProseMirror happens in the various repositories exposed under the ProseMirror organization on GitHub. Bugs for core packages are tracked in the bug tracker for the meta repository.

We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.

prosemirror's People

Contributors

adrianheine avatar doodlewind avatar ericandrewlewis avatar k15a avatar marijnh avatar torifat avatar vandenoever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prosemirror's Issues

Floating tooltip position

if the selection happens in some edges of the editable div the floating tooltip appears on the other side.

To reproduce go to (prosemirror)[http://prosemirror.net/] page and select the most bottom left word "control", the tooltip menu would appear in the far right side of the div.

Nesting lists

It is currently possible and I was wondering If it is possible to allow the creation of a nesting as in this example?

syntax highlighting for code blocks?

Would a plugin to edit code within the ProseMirror flow be possible? (For example after typing ``` .)

I'm working on an editor with arbitrary media overlays (audio, video, maps, code), but ProseMirror's architecture seems much more sane than what I've hacked with Scribe.

menubar require _edit.defineOption not a function

Uncaught TypeError: (0 , _edit.defineOption) is not a function when including menubar as outlined in manual > Bundling...

var ProseMirror = require("./edit/main").ProseMirror
require("./menu/menubar");

var editor = new ProseMirror({
          place: param1,
          menuBar: { float: true },
          doc: "Hello!",
          docFormat: "text"
      })

fromDOM losing space between em and strong

Noticed a bug in my fixture where this was getting rendered without spaces. In test/test-dom.js:

recover("dont_ignore_whitespace",
        "<p><em>one</em> <strong>two</strong></p>",
        doc(p(em("one"), " ", strong("two"))))

Failure:

dom_recover_dont_ignore_whitespace: Failure: different content length at doc.0
 in doc(paragraph(em("one"), strong("two")))
 vs doc(paragraph(em("one"), " ", strong("two")))

LaTeX and Table Support

It would be really great if prosemirror can be used to edit scientific documents a la overleaf.

Prevent nested Lists

First thanks for this great piece of software.

Is it somehow possible to prevent list nesting?

I have the usecase where users shouldn't be able to do this.

I just look into the command.js module but can't figure out a way to prevent wrapping another bullet_list.

Editing existing link

In the demo's, you cannot edit the url, only toggle it off and then re-add the url. For a user this is not very friendly.

Deregister items from the menubar

I haven't found a way to remove buttons or functionality from the toolbar. I think menu/items.js should export deregisterItem():

export function deregisterItem(tag, item) {
  (tags[tag] || (tags[tag] = []));
  let index = tags[tag].indexOf(item);
  if (index > -1) {
    tags[tag].splice(index, 1);
  }
}

list items wrap p, don't make new li on return

On http://prosemirror.net/ in Firefox and Chrome,

  1. make a new line
  2. switch it to list with side menu
  3. try to add a new line

expected html:

<ul pm-path="2">
  <li pm-path="0"><span pm-span="0">list item one</span></li>
  <li pm-path="1"><span pm-span="0">two</span></li>
</ul>

actual html:

<ul pm-path="2">
  <li pm-path="0">
    <p pm-path="0"><span pm-span="0-13">list item one</span></p>
    <p pm-path="1"><span pm-span="0-1">two</span></p>
  </li>
</ul>

screen shot 2015-10-27 at 2 38 27 pm

Image resizing should be disabled

... not only because it adds width and height (or worse style) attributes but also is buggy when dragging arround.

prose dnd resize

I believe this is disabled by something similar like

document.execCommand("enableObjectResizing", false, "false");
document.execCommand("enableInlineTableEditing", false, "false");

or by listening on the resize event:

image.attachEvent("onresizestart", function(e) { e.returnValue = false; }, false);

Disclaimer: these snippets are copied from the web.

Link rendering inconsistency with `docFormat` set to "markdown"

Repro Steps

  1. Navigate to the Markdown editing demo
  2. Click the "WYSIWYM" radio button to toggle to WYSIWYM view
  3. Select the word "comment" (any undecorated text would do)
    select a word
  4. Click the button for creating a hyperlink
  5. Enter in "Google" for the title and "http://www.google.com" for the URL
    fill out the form
  6. Note that the selected text is now a hyperlink
    selected text is hyperlinked
  7. Click the "Markdown" radio button to toggle to markdown view
  8. Click the "WYSIWYM" radio button to toggle to WYSIWYM view

Expected Results

The selected text would be as it appeared before briefly toggling to markdown view.
selected text is hyperlinked

Actual Results

The selected text is no longer hyperlinked, and is instead rendered as [selected text](http://www.google.com Google)
selected text is rendered as raw markdown

pm.getContent("html") produces type error

Uncaught TypeError: Cannot read property 'document' of undefined(…)
toHTML  @   dom.js:18
convertTo   @   index.js:6
getContent  @   main.js:99
(anonymous function)    @   VM739:2
InjectedScript._evaluateOn  @   VM738:875
InjectedScript._evaluateAndWrap @   VM738:808
InjectedScript.evaluate @   VM738:664

This is because document is not passed to convertTo() since 1a4c78a9.

Deleting all content crashes editor with `docFormat` of "markdown"

Repro Steps

  1. Navigate to the Markdown editing demo
  2. Delete all the content
  3. Check the "WYSIWYM" radio button
  4. Enter some text
  5. Check the "Markdown" radio button

Expected Results

The markdown textarea shows the entered text.

Actual Results

The markdown textarea is empty.

Notes

The JavaScript console shows the error: demo_markdown_built.js:3841 Uncaught TypeError: Cannot read property 'cmp' of undefined

Drag and Drop Images

Do you plan on supporting dragging and dropping of images into Prose Mirror in the future?

Problem with setContent()

Setting the content with the ProseMirrorr constructor works fine:

var editor = new ProseMirror({
  place: myElement,
  docFormat: myFormat,
  doc: myContent
});

but this fails for me:

var editor = new ProseMirror({
  place: myElement
});
editor.setContent({
  format: myFormat,
  value: myContent
});

Publish prosemirror to the npm registry

The package.json uses the package name prosemirror but it's not available on npm yet. You should publish it at least to reserve the name before someone else does.

nodeBefore() is not defined

When I use wiith IME, I encountered nodeBefore function doesn't exist and Input was failed.
domchange.js L93 failed.

let before = start.childNodes[range.startOffset - 1] || nodeBefore(start)

I grepped nodeBefore but there is no function. nodeAfter function exists but it may return null so it has possibility to fail at next line in this textContent.

Suggested way to save the content

What is you suggested way to save content generated by ProseMirror?
I mean do you think it is better to store HTML? Markdown? Or maybe some internal data model?
Maybe some kind of delta?

The fact that you internally work with an abstraction data model seems very interesting and so I think that maybe using it also for storage can have some advantages.
I think this is also related in someway to collaborative editing right?

P.S. Congratulations for you work, I hope you manage to get the funds....

error occur when use webpack to package the project

Hash: a7e67fc458a9cba10338
Version: webpack 1.12.2
Time: 18050ms
Asset Size Chunks Chunk Names
bundle.js 226 kB 0 [emitted] main
+ 50 hidden modules

ERROR in ./src/edit/commands.js
Module build failed: Error: C:/Users/zhou/Desktop/prosemirror/src/edit/commands.js: We found a path that isn't a NodePath instance
at Function.get (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\path\index.js:103:13)
at TraversalContext.create (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:73:30)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:102:25)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:139:17)
at traverse (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:61:12)
at Function.traverse.hasType (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:188:3)
at BlockScoping.wrapClosure (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:491:47)
at BlockScoping.run (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:383:12)
at PluginPass.Loop (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:89:36)
at newFn (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\visitors.js:233:27)
at NodePath._call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:72:18)
at NodePath.call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:44:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:102:12)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitSingle (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:111:19)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:195:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
@ ./src/edit/index.js 61:16-37

ERROR in ./src/edit/input.js
Module build failed: Error: C:/Users/zhou/Desktop/prosemirror/src/edit/input.js: We found a path that isn't a NodePath instance
at Function.get (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\path\index.js:103:13)
at TraversalContext.create (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:73:30)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:102:25)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:139:17)
at traverse (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:61:12)
at Function.traverse.hasType (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:188:3)
at BlockScoping.wrapClosure (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:491:47)
at BlockScoping.run (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:383:12)
at PluginPass.Loop (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:89:36)
at newFn (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\visitors.js:233:27)
at NodePath._call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:72:18)
at NodePath.call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:44:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:102:12)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitSingle (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:111:19)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:195:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
@ ./src/edit/main.js 32:13-31

ERROR in ./src/transform/ancestor.js
Module build failed: Error: C:/Users/zhou/Desktop/prosemirror/src/transform/ancestor.js: We found a path that isn't a NodePath instance
at Function.get (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\path\index.js:103:13)
at TraversalContext.create (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:73:30)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:102:25)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:139:17)
at traverse (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:61:12)
at Function.traverse.hasType (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:188:3)
at BlockScoping.wrapClosure (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:491:47)
at BlockScoping.run (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:383:12)
at PluginPass.Loop (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:89:36)
at newFn (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\visitors.js:233:27)
at NodePath._call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:72:18)
at NodePath.call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:44:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:102:12)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitSingle (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:111:19)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:195:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
@ ./src/transform/index.js 32:16-37

ERROR in ./src/transform/replace.js
Module build failed: Error: C:/Users/zhou/Desktop/prosemirror/src/transform/replace.js: We found a path that isn't a NodePath instance
at Function.get (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\path\index.js:103:13)
at TraversalContext.create (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:73:30)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:102:25)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:139:17)
at traverse (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:61:12)
at Function.traverse.hasType (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\node_modules\babel-traverse\lib\index.js:188:3)
at BlockScoping.wrapClosure (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:491:47)
at BlockScoping.run (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:383:12)
at PluginPass.BlockStatementProgram (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-block-scoping\lib\index.js:96:24)
at newFn (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\visitors.js:233:27)
at NodePath._call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:72:18)
at NodePath.call (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:44:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:102:12)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitSingle (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:111:19)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:195:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitMultiple (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:106:17)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:193:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
at TraversalContext.visitSingle (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:111:19)
at TraversalContext.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:195:19)
at Function.traverse.node (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\index.js:139:17)
at NodePath.visit (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\path\context.js:106:22)
at TraversalContext.visitQueue (C:\Users\zhou\Desktop\prosemirror\node_modules\babel-core\node_modules\babel-traverse\lib\context.js:151:16)
@ ./src/transform/index.js 93:0-20

Tests fail on Microsoft Edge Browser

Using the latest preview of Windows 10 build 10532 and commit 7ae0a0a, four tests fail:

  • selection_read: TypeError: Argument not optional
  • selection_set: TypeError: Argument not optional
  • selection_coords_cornercases: Failure: expected 0:14, got 0:0
  • selection_coords_round_trip: Failure: expected 1/1:2, got 1/1:0

Right now the Edge browser is by far in the minority but who knows. Also support the Edge browser enables writing Universal Apps for Windows 10 that can be installed locally.

I am happy to help as much as possible but need some guidance.

ProseMirror Constructor undefined

I would like to load ProseMirror into a Polymer element. after loading browserified prosemirror bundle into my component. The Constructor reference is undefined.
The error returned is:
Uncaught ReferenceError: ProseMirror is not defined

Code:
var editor = new ProseMirror({
place: this.$.editor,
doc: "Hello!",
docFormat: "text"
})

babelify install

Just a heads up. Running 'npm run dist' on a pretty clean Ubuntu install barfs on babelify. Installing babelify globally fixes this both on my local machine and in a nitrous.io cloud dev environment, so not a big deal.

  • TCB

npm run demo fails

[email protected] demo /var/www/html/author/components/prosemirror
watchify -d --outfile demo/demo-built.js -t babelify demo/demo.js

sh: 1: watchify: not found

npm ERR! [email protected] demo: watchify -d --outfile demo/demo-built.js -t babelify demo/demo.js
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] demo script.
npm ERR! This is most likely a problem with the prosemirror package,
npm ERR! not with npm itself.

Paste is not sanitized in IE

I believe this to be due to missing oninput events in IE. Afaik you need to do something like a reocurring cleanup (setTimeout) to catch these.

paste

Consider joining forces with quilljs?

Hey,

I did some research on different rich text editors a while a go and it seems what you are trying to achieve is already being done by other people as well :) Just wanted to have your opinion on why you think your direction is different (or maybe the same) and maybe you could team up with them. The editor i am referring to is https://github.com/quilljs/quill. It is implementing the ottypes spec (https://github.com/ottypes) which is also used by the popular sharejs (http://sharejs.org/) which aims at collaborative editing. Seems they are doing good things but it lacks proper integration between the two (josephg/ShareJS#1). Again i am not saying your implementation is bad, just wanted to point you to this resource and see what you are thinking about it.

Keep inline styles when pasting

Not quite an issue, but a question. I'd like to have an option of keeping all (or some) inline styles when pasting formatted text from a web page. Or how do I allow any arbitrary attributes in HTML doc? What would be the easiest way to achieve that?

Empty paragraph issue on android.

To reproduce the issue:
Start a new paragraph by pressing enter on the end of a line.
Type a word.
When you press space, the cursor moves to the beginning of the paragraph.

Android 4.4.2 Chrome version 46.0.2490.76 also same issue with this android's stock browser.
I could also reproduce this on Android 4.2.2 in chrome, but at that version the stock browser seems to be working fine.

no width and height attributes in Image default schema

I am talking about Image definition in model/defaultscheme.js

Image.attributes = {
  src: new Attribute,
  title: new Attribute(""),
  alt: new Attribute("")
}

Is there a reason those attributes are omitted ?

what I want to do is some simple manipulation of certain elements as shown in the linter example (where an alt attribute gets added to img tags). So for having access to the width and height, do I have to extend myself the schema as shown in the dino example ?

The WYSIWYG mode may refer this

Wow, this project is very cool!
I like it very much!

But the WYSIWYG mode won't able to convert back to markdown.
And I saw something familiar on the net.
http://typora.io/
Maybe can give you some ideas.

Support you and Thank you!

Make it possible to escape from list item to next list item

Currently, if you're in a wrapped continued list item, you can't get back to the original list.

We're using backspace as conceptually blanking out stuff in front of the cursor, so backspace in a (non-first) list item removes the number, putting you into the item above.

So we can't also use backspace to get out of a continued item -- that'd get you in a loop where you can't escape from the list itself.

Currently enter in an empty continued list item will escape the list. Making it get you back into the list item doesn't seem like it'd make a lot of sense.

Overloading the wrap-in-list control for this is also not acceptable -- you might want to create a nested list in this situation.

Not sure what options that leaves us with.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.