Skip to content

Commit

Permalink
Fix typo in text-serializers-from-schema function
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdemartini authored and bdbch committed May 17, 2022
1 parent 155955c commit 819622c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getHTMLFromFragment } from './helpers/getHTMLFromFragment'
import { getText } from './helpers/getText'
import { isNodeEmpty } from './helpers/isNodeEmpty'
import { resolveFocusPosition } from './helpers/resolveFocusPosition'
import { getTextSeralizersFromSchema } from './helpers/getTextSeralizersFromSchema'
import { getTextSerializersFromSchema } from './helpers/getTextSerializersFromSchema'
import { createStyleTag } from './utilities/createStyleTag'
import { isFunction } from './utilities/isFunction'
import { CommandManager } from './CommandManager'
Expand Down Expand Up @@ -436,7 +436,7 @@ export class Editor extends EventEmitter<EditorEvents> {
blockSeparator,
textSerializers: {
...textSerializers,
...getTextSeralizersFromSchema(this.schema),
...getTextSerializersFromSchema(this.schema),
},
})
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/extensions/clipboardTextSerializer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Plugin, PluginKey } from 'prosemirror-state'
import { Extension } from '../Extension'
import { getTextBetween } from '../helpers/getTextBetween'
import { getTextSeralizersFromSchema } from '../helpers/getTextSeralizersFromSchema'
import { getTextSerializersFromSchema } from '../helpers/getTextSerializersFromSchema'

export const ClipboardTextSerializer = Extension.create({
name: 'clipboardTextSerializer',
Expand All @@ -18,7 +18,7 @@ export const ClipboardTextSerializer = Extension.create({
const { ranges } = selection
const from = Math.min(...ranges.map(range => range.$from.pos))
const to = Math.max(...ranges.map(range => range.$to.pos))
const textSerializers = getTextSeralizersFromSchema(schema)
const textSerializers = getTextSerializersFromSchema(schema)
const range = { from, to }

return getTextBetween(doc, range, {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/helpers/generateText.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Node } from 'prosemirror-model'
import { getSchema } from './getSchema'
import { Extensions, JSONContent, TextSerializer } from '../types'
import { getTextSeralizersFromSchema } from './getTextSeralizersFromSchema'
import { getTextSerializersFromSchema } from './getTextSerializersFromSchema'
import { getText } from './getText'

export function generateText(
Expand All @@ -23,7 +23,7 @@ export function generateText(
blockSeparator,
textSerializers: {
...textSerializers,
...getTextSeralizersFromSchema(schema),
...getTextSerializersFromSchema(schema),
},
})
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Schema } from 'prosemirror-model'
import { TextSerializer } from '../types'

export function getTextSeralizersFromSchema(schema: Schema): Record<string, TextSerializer> {
export function getTextSerializersFromSchema(schema: Schema): Record<string, TextSerializer> {
return Object.fromEntries(Object
.entries(schema.nodes)
.filter(([, node]) => node.spec.toText)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export * from './helpers/getNodeAttributes'
export * from './helpers/getNodeType'
export * from './helpers/getText'
export * from './helpers/getTextBetween'
export * from './helpers/getTextSeralizersFromSchema'
export * from './helpers/getTextSerializersFromSchema'
export * from './helpers/isActive'
export * from './helpers/isList'
export * from './helpers/isMarkActive'
Expand Down

0 comments on commit 819622c

Please sign in to comment.