prosemirror-schema-basic 0.16.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,13 +68,12 @@ var nodes = {
68
68
  group: "block",
69
69
  code: true,
70
70
  defining: true,
71
- parseDOM: [{tag: "pre", preserveWhitespace: true}],
71
+ parseDOM: [{tag: "pre", preserveWhitespace: "full"}],
72
72
  toDOM: function toDOM() { return ["pre", ["code", 0]] }
73
73
  },
74
74
 
75
75
  text: {
76
- group: "inline",
77
- toDOM: function toDOM(node) { return node.text }
76
+ group: "inline"
78
77
  },
79
78
 
80
79
  image: {
@@ -108,15 +107,27 @@ exports.nodes = nodes
108
107
 
109
108
  // :: Object
110
109
  //
110
+ // link:: MarkSpec A link. Has `href` and `title` attributes.
111
+ // `title` defaults to the empty string.
112
+ //
111
113
  // em:: MarkSpec An emphasis mark.
112
114
  //
113
115
  // strong:: MarkSpec A strong mark.
114
116
  //
115
- // link:: MarkSpec A link. Has `href` and `title` attributes.
116
- // `title` defaults to the empty string.
117
- //
118
117
  // code:: MarkSpec Code font mark.
119
118
  var marks = {
119
+ link: {
120
+ attrs: {
121
+ href: {},
122
+ title: {default: null}
123
+ },
124
+ inclusive: false,
125
+ parseDOM: [{tag: "a[href]", getAttrs: function getAttrs(dom) {
126
+ return {href: dom.getAttribute("href"), title: dom.getAttribute("title")}
127
+ }}],
128
+ toDOM: function toDOM(node) { return ["a", node.attrs] }
129
+ },
130
+
120
131
  em: {
121
132
  parseDOM: [{tag: "i"}, {tag: "em"},
122
133
  {style: "font-style", getAttrs: function (value) { return value == "italic" && null; }}],
@@ -133,17 +144,6 @@ var marks = {
133
144
  toDOM: function toDOM() { return ["strong"] }
134
145
  },
135
146
 
136
- link: {
137
- attrs: {
138
- href: {},
139
- title: {default: null}
140
- },
141
- parseDOM: [{tag: "a[href]", getAttrs: function getAttrs(dom) {
142
- return {href: dom.getAttribute("href"), title: dom.getAttribute("title")}
143
- }}],
144
- toDOM: function toDOM(node) { return ["a", node.attrs] }
145
- },
146
-
147
147
  code: {
148
148
  parseDOM: [{tag: "code"}],
149
149
  toDOM: function toDOM() { return ["code"] }
@@ -157,7 +157,6 @@ exports.marks = marks
157
157
  // [schema-list](#schema-list) module.
158
158
  //
159
159
  // To reuse elements from this schema, extend or read from its
160
- // [`nodeSpec`](#model.Schema.nodeSpec) and
161
- // [`markSpec`](#model.Schema.markSpec) properties.
160
+ // `spec.nodes` and `spec.marks` [properties](#model.Schema.spec).
162
161
  var schema = new Schema({nodes: nodes, marks: marks})
163
162
  exports.schema = schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prosemirror-schema-basic",
3
- "version": "0.16.0",
3
+ "version": "0.20.0",
4
4
  "description": "Basic schema elements for ProseMirror",
5
5
  "main": "dist/schema-basic.js",
6
6
  "license": "MIT",
@@ -16,7 +16,7 @@
16
16
  "url": "git://github.com/prosemirror/prosemirror-schema-basic.git"
17
17
  },
18
18
  "dependencies": {
19
- "prosemirror-model": "^0.16.0"
19
+ "prosemirror-model": "^0.20.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "buble": "^0.15.1",
@@ -67,13 +67,12 @@ const nodes = {
67
67
  group: "block",
68
68
  code: true,
69
69
  defining: true,
70
- parseDOM: [{tag: "pre", preserveWhitespace: true}],
70
+ parseDOM: [{tag: "pre", preserveWhitespace: "full"}],
71
71
  toDOM() { return ["pre", ["code", 0]] }
72
72
  },
73
73
 
74
74
  text: {
75
- group: "inline",
76
- toDOM(node) { return node.text }
75
+ group: "inline"
77
76
  },
78
77
 
79
78
  image: {
@@ -107,15 +106,27 @@ exports.nodes = nodes
107
106
 
108
107
  // :: Object
109
108
  //
109
+ // link:: MarkSpec A link. Has `href` and `title` attributes.
110
+ // `title` defaults to the empty string.
111
+ //
110
112
  // em:: MarkSpec An emphasis mark.
111
113
  //
112
114
  // strong:: MarkSpec A strong mark.
113
115
  //
114
- // link:: MarkSpec A link. Has `href` and `title` attributes.
115
- // `title` defaults to the empty string.
116
- //
117
116
  // code:: MarkSpec Code font mark.
118
117
  const marks = {
118
+ link: {
119
+ attrs: {
120
+ href: {},
121
+ title: {default: null}
122
+ },
123
+ inclusive: false,
124
+ parseDOM: [{tag: "a[href]", getAttrs(dom) {
125
+ return {href: dom.getAttribute("href"), title: dom.getAttribute("title")}
126
+ }}],
127
+ toDOM(node) { return ["a", node.attrs] }
128
+ },
129
+
119
130
  em: {
120
131
  parseDOM: [{tag: "i"}, {tag: "em"},
121
132
  {style: "font-style", getAttrs: value => value == "italic" && null}],
@@ -132,17 +143,6 @@ const marks = {
132
143
  toDOM() { return ["strong"] }
133
144
  },
134
145
 
135
- link: {
136
- attrs: {
137
- href: {},
138
- title: {default: null}
139
- },
140
- parseDOM: [{tag: "a[href]", getAttrs(dom) {
141
- return {href: dom.getAttribute("href"), title: dom.getAttribute("title")}
142
- }}],
143
- toDOM(node) { return ["a", node.attrs] }
144
- },
145
-
146
146
  code: {
147
147
  parseDOM: [{tag: "code"}],
148
148
  toDOM() { return ["code"] }
@@ -156,7 +156,6 @@ exports.marks = marks
156
156
  // [schema-list](#schema-list) module.
157
157
  //
158
158
  // To reuse elements from this schema, extend or read from its
159
- // [`nodeSpec`](#model.Schema.nodeSpec) and
160
- // [`markSpec`](#model.Schema.markSpec) properties.
159
+ // `spec.nodes` and `spec.marks` [properties](#model.Schema.spec).
161
160
  const schema = new Schema({nodes, marks})
162
161
  exports.schema = schema