Skip to content

Commit

Permalink
yarn fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tdaron committed Dec 9, 2023
1 parent 068d672 commit 82b7cde
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/slate/src/editor/marks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Range } from '../interfaces/range'
import { Path } from '../interfaces/path'
import { Text } from '../interfaces/text'
import { Element } from '../interfaces/element'
import {Point} from "../interfaces";
import { Point } from '../interfaces'

export const marks: EditorInterface['marks'] = (editor, options = {}) => {
const { marks, selection } = editor
Expand All @@ -23,11 +23,15 @@ export const marks: EditorInterface['marks'] = (editor, options = {}) => {
if (isEnd) {
const after = Editor.after(editor, anchor as Point)
// Editor.after() might return undefined
anchor = (after || anchor)
anchor = after || anchor
}
const [match] = Editor.nodes(editor, { match: Text.isText, at: {
anchor, focus
} })
const [match] = Editor.nodes(editor, {
match: Text.isText,
at: {
anchor,
focus,
},
})
if (match) {
const [node] = match as NodeEntry<Text>
const { text, ...rest } = node
Expand Down

0 comments on commit 82b7cde

Please sign in to comment.