Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

draftmirror

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draftmirror - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

30

lib/models/editorState.js
var Immutable = require('immutable');
var normalizeNewline = require('normalize-newline');
var schema = require('prosemirror/dist/schema-basic').schema;

@@ -198,3 +199,3 @@ var Node = require('prosemirror/dist/model/node').Node;

/**
* Create a raw editor state from a text
* Create a raw editor state from a text, each line gets its own block.
* @param {String} text

@@ -208,15 +209,20 @@ * @return {EditorState}

text = normalizeNewline(text);
var lines = text.split(/\n/);
var blocks = lines.map(function(line) {
return {
type: textType,
'content': line? [
{
type: styleType,
text: line
}
] : []
};
});
return EditorState.createFromJSON(schema, {
'type': docType,
'content': [
{
type: textType,
'content': text? [
{
type: styleType,
text: text
}
] : []
}
]
'content': blocks
});

@@ -223,0 +229,0 @@ };

3

package.json
{
"name": "draftmirror",
"version": "0.6.0",
"version": "0.6.1",
"description": "React component for ProseMirror providing a Draft.js like API",

@@ -33,2 +33,3 @@ "main": "./lib/index.js",

"is": "^3.1.0",
"normalize-newline": "^2.0.0",
"prosemirror": "^0.8.1",

@@ -35,0 +36,0 @@ "react": "^15.1.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc